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

Backwards text typing on empty, nested, editable void Slate Editor #4293

Closed
davidruisinger opened this issue May 26, 2021 · 3 comments · Fixed by #4304, #4627 or #4885
Closed

Backwards text typing on empty, nested, editable void Slate Editor #4293

davidruisinger opened this issue May 26, 2021 · 3 comments · Fixed by #4304, #4627 or #4885
Labels

Comments

@davidruisinger
Copy link
Contributor

Description
When there is NO text, yet within a nested, editoable void Slate Editor (see editable voids example, starting to type some text leads to backwards typing.

Recording
khkYcJF2rp

Sandbox
Can be reproduced in the editable voids example.

Steps
To reproduce the behavior:

  1. Go to editable voids example
  2. Delete all text within the nested Slate Editor
  3. Start typing
  4. See the first letter beeing shifted to the very beginning

Expectation
Text should be added as it is typed

Environment

  • Slate & Slate-React Version: 0.63.0
  • Operating System: MacOS
  • Browser: Chrome & Safari

Context
This might be connected to #4275

@davidruisinger davidruisinger changed the title Backwards test typing on empty, nested, editable void Slate Editor Backwards text typing on empty, nested, editable void Slate Editor May 31, 2021
jameshfisher added a commit to jameshfisher/slate that referenced this issue Oct 25, 2021
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.
@dylans dylans reopened this Oct 25, 2021
dylans pushed a commit that referenced this issue Oct 25, 2021
* 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
@moxxuk
Copy link

moxxuk commented Nov 2, 2021

Can this ticket please be re-opened, as the fix was reverted? We need nested editable voids in our app, and we are suffering the cursor bug. Also, is there a workaround I can use until it is fixed?

@dylans dylans reopened this Nov 2, 2021
@angjiang
Copy link

this is also extremely problematic for us. having nested editable voids is a big part of our app but this bug makes the nested editor unusable. is there anything we can do try to normalize or force the selection while the root is being addressed?

@nalband
Copy link

nalband commented Jan 24, 2022

This is causing major issues for our product too. It totally breaks one of our core integrations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment