Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added correct explanations to offsets in selection api docs #37630

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

Agog-io
Copy link
Contributor

@Agog-io Agog-io commented Jan 13, 2025

Description

The Selection api anchorOffset and focusOffset docs are hugely misleading and data on this matter is very scarce. I clarified what those offset return in the case of a non texty node in anchorNode or focusNode

Motivation

A custom project I am working on heavily reliant on selection api. The docs on this matter are scarce and there are a lot of caveats not mentioned anywhere or in very obscure parts of programming forums. This specificly came up from testing my project and this SO issue which also mentions fixing MDN docs but i guessed there was a regression from 2013 to today.

@Agog-io Agog-io requested a review from a team as a code owner January 13, 2025 12:59
@Agog-io Agog-io requested review from bsmth and removed request for a team January 13, 2025 12:59
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Jan 13, 2025
Copy link
Contributor

github-actions bot commented Jan 13, 2025

Preview URLs

(comment last updated: 2025-01-14 08:59:12)

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks a lot for the additions

@bsmth bsmth merged commit eea0f3e into mdn:main Jan 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants