-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Do NOT use exact match when updating dom selection #4304
Do NOT use exact match when updating dom selection #4304
Conversation
🦋 Changeset detectedLatest commit: 528d3c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I tried to debug the Unfortunately I wasn't able to find a fix, yet. I'd really appreciate if someone else could have a look at this as well. |
I also ran into this issue. After debugging the Here in In the case below, the anchor node of the DOM selection is the editable DOM element rather than the html text node. So Screen.Recording.2021-06-26.at.2.47.43.PM.movThe DOM selection after deletion: Things work fine outside the editable void because the leaf node will always be undefined and won't be corrected by the void node. So the DOM selection is always updated by the slate selection since it's out of sync. |
I will look this later. I think we should fix |
This cursor bug makes the nested editors unusable in production, I would be in favor to merge this until we find a fix inside |
Accepting and landing this for now, until we can come up with something better. |
The change to `exactMatch: false` in ianstormtaylor#4304 was intended to fix ianstormtaylor#4293, a bug where "backwards typing" happened in nested editors. But this change has introduced at least two new bugs: - ianstormtaylor#4601 - ianstormtaylor#4626 These are (IMO) worse than the original "backwards typing" bug. From discussion in ianstormtaylor#4304, the true underlying bug is in ReactEditor.toSlateRange. I'll attempt to fix this underlying bug instead.
* Revert "Do NOT use exact match when updating dom selection" The change to `exactMatch: false` in #4304 was intended to fix #4293, a bug where "backwards typing" happened in nested editors. But this change has introduced at least two new bugs: - #4601 - #4626 These are (IMO) worse than the original "backwards typing" bug. From discussion in #4304, the true underlying bug is in ReactEditor.toSlateRange. I'll attempt to fix this underlying bug instead. * changeset
Description
When there is NO text, yet within a nested, editable void Slate Editor (see editable voids example, starting to type some text leads to backwards typing.
Issue
Fixes: #4293
Example
Before:
After:
Context
The bug seems to have been introduced with #4157 so it would be great if @githoniel could have another look at this
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)