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

Cursor bug in nested editor #942

Closed
zbeyens opened this issue Aug 17, 2021 · 5 comments
Closed

Cursor bug in nested editor #942

zbeyens opened this issue Aug 17, 2021 · 5 comments
Labels
bug Something isn't working slate wontfix This will not be worked on

Comments

@zbeyens
Copy link
Member

zbeyens commented Aug 17, 2021

Originally posted by calmound August 13, 2021
Hello, the cursor that the position of end move to the beginning when I input some letter.The detail that you can watch the video.
the demo url: https://slate-plugins.udecode.io/docs/examples/editable-voids/

2021-08-13.3.58.06.mov
@zbeyens zbeyens added bug Something isn't working examples labels Aug 17, 2021
@zbeyens
Copy link
Member Author

zbeyens commented Sep 25, 2021

From slate 0.66.1, this happens only when there is 0 character (for insert) or 1 character (for delete)

@zbeyens
Copy link
Member Author

zbeyens commented Sep 26, 2021

https://github.com/ianstormtaylor/slate/blob/bc85497d58dc2eddb0918eed4c7d25d040fa653f/packages/slate-react/src/components/editable.tsx#L317

Found out that event.getTargetRanges() returns a range at offset 0, so it's triggering a select because it differs from the editor selection (offset 1 after typing 1 character)
CleanShot 2021-09-26 at 11 16 03

@zbeyens zbeyens added slate and removed examples labels Sep 26, 2021
@zbeyens
Copy link
Member Author

zbeyens commented Sep 26, 2021

This is a slate bug, it also happens in https://www.slatejs.org/examples/editable-voids

CleanShot.2021-09-27.at.00.03.33.mp4

Will close this in favor of ianstormtaylor/slate#4293

@zbeyens zbeyens changed the title Cursor bug in editable voids example Cursor bug in nested editor Sep 26, 2021
@zbeyens zbeyens closed this as completed Sep 26, 2021
@karthikcodes6
Copy link
Collaborator

The fix has been reverted ianstormtaylor/slate#4627

@karthikcodes6 karthikcodes6 reopened this Mar 1, 2022
@zbeyens
Copy link
Member Author

zbeyens commented Mar 1, 2022

Let's track it in ianstormtaylor/slate#4842

@zbeyens zbeyens closed this as completed Mar 1, 2022
@zbeyens zbeyens added the wontfix This will not be worked on label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working slate wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants