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

Attempting to remove a mark after deselecting and reselecting the marked text does not work. #5574

Closed
bradcypert opened this issue Nov 30, 2023 · 0 comments · Fixed by #5580
Labels

Comments

@bradcypert
Copy link

bradcypert commented Nov 30, 2023

Description
Selecting text, adding a mark, deselecting the text, then reselecting the text and trying to remove the mark does not seem to work. This is the case in both Slate 0.101.1 for my local development and I was able to recreate the issue with Slate's Rich Editor demo application.

Recording
slate-bug(2)

Sandbox
You are able to reproduce this issue here as well: https://www.slatejs.org/examples/richtext

Steps
To reproduce the behavior:

  1. Open the link to the rich text example: https://www.slatejs.org/examples/richtext
  2. double click to select a word with no marks (such as the 5th word "text").
  3. Click on the "Bold" button to add a bold mark to the text.
  4. Click on "Bold" button again to remove the mark
  5. Observe that this behavior works as expected.
  6. Click on "Bold" button again to add the mark once more.
  7. Deselect the currently selected text
  8. Double click to previously selected text to select it once more.
  9. Click on "Bold" button again and observe that the mark is not removed this time.

Expectation
I'd expect for the mark to be removed since it's already applied to the selection.

Environment

  • Slate Rich Text Editor Demo Application (link above)
  • Additionally, Slate 0.101.1

Context
I'm still learning how Slate works but if someone can point me in the right direction regarding the internals here, I'd be happy to take a look at fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant