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

Fix caretRangeFromPoint for Firefox #6598

Merged
merged 2 commits into from
May 5, 2018
Merged

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented May 4, 2018

Description

Currently there is an error in Firefox when moving the caret down with the arrow key, and the target block is outside of the viewport. In that case caretPositionFromPoint returns null and range.setStart fails. There will be no scrolling with a second attempt. To fix this we have to return null to prevent the error, and a second attempt will be made by scrolling the page.

How has this been tested?

See above.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@ellatrix ellatrix added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label May 4, 2018
@ellatrix ellatrix added this to the 2.9 milestone May 4, 2018
@ellatrix ellatrix requested review from aduth and a team May 4, 2018 18:33
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Confirmed resolves error 👍

Is there some documentation / specification that describes this behavior we could include as a reference link? Or mention that it's Firefox-specific?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants