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 error when triple-clicking a word preceding a contenteditable="false" DOM node in Chrome #5343

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

12joan
Copy link
Contributor

@12joan 12joan commented Mar 7, 2023

Description
Triple-clicking a word in Chrome will sometimes place the focus inside a contenteditable="false" DOM node following the word, which causes toSlatePoint to throw an error. This PR checks for this and adjusts the focusNode if necessary.

Issue
Fixes #5341

Context
#4329 (comment)

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@dylans dylans merged commit f7f02a8 into ianstormtaylor:main Mar 7, 2023
@12joan 12joan deleted the bug/triple-click-crash branch March 7, 2023 17:16
This was referenced Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slate run toSlatePoint on a non-contentEditable when triple-clicking on a word
3 participants