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

Extend the getTargetRanges method documentation #30718

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

jGowgiel
Copy link
Contributor

@jGowgiel jGowgiel commented Dec 1, 2023

Description

Introduce a new table mirroring an existing table in the W3C spec that explains the expected return values for the getTargetRanges method. Notably, this table highlights that for editing hosts that are not contenteditable, the expected return value for this method is an empty array (which is not currently clear anywhere except the W3C docs).

Motivation

When experimenting with beforeinput and getTargetRanges, I was confused to find that the result seemed to always be an empty array (even when I thought I was configuring everything correctly). The existing docs didn't explain that, per the W3C spec, returning an empty array is the expected behavior in certain scenarios.

Additional details

Matching W3C spec: https://w3c.github.io/input-events/#interface-InputEvent-Methods

Introduce a new table mirroring an existing table in the W3C spec
that explains the expected return values for the getTargetRanges
method. Notably, this table highlights that for editing hosts that
are not contenteditable, the expected return value for this method
is an empty array (which is not currently clear anywhere except the
W3C docs).
@jGowgiel jGowgiel requested a review from a team as a code owner December 1, 2023 18:46
@jGowgiel jGowgiel requested review from sideshowbarker and removed request for a team December 1, 2023 18:46
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 1, 2023
Copy link
Contributor

github-actions bot commented Dec 1, 2023

@sideshowbarker sideshowbarker merged commit 39cbb47 into mdn:main Dec 2, 2023
6 checks passed
@sideshowbarker
Copy link
Member

@jGowgiel, thanks much, and congrats on landing your first docs change here — welcome aboard 🎉

estelle pushed a commit to estelle/content that referenced this pull request Dec 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants