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

Firefox: Marking not working correctly #4793

Closed
matobiely opened this issue Jan 19, 2022 · 6 comments
Closed

Firefox: Marking not working correctly #4793

matobiely opened this issue Jan 19, 2022 · 6 comments

Comments

@matobiely
Copy link

Description
On Firefox, mark text italic, underline or strikethrough is not working correctly. Once you mark selection with format, after reselect the formated selection, Editor does not recognize it as marked/formated text.
Only working format is bold.

Recording
slate issue

Steps
To reproduce the behavior:

  1. Go to https://www.slatejs.org/examples/richtext on Firefox
  2. Type some text
  3. Select text
  4. Mark it as italic or underline
  5. Cancel selection
  6. Select marked text again
  7. Editor does not know that text is marked

Expectation
Working as it should

Environment

  • Slate Version: [e.g. 0.72.3]
  • Operating System: [macOS]
  • Browser: [Firefox]
@dylans
Copy link
Collaborator

dylans commented Jan 19, 2022

The issue here I think is one of the selection range extending beyond the word. If I double click on the word, it's selecting slightly beyond the word selection. If I drag select from the start to end of the word or vice versa, it remains as italic or underline. Bold only works for you because it was the first word. If you make the first word in a paragraph italic or underline and then clear the selection and highlight it, you'll get the correct value in the toolbar.

@matobiely
Copy link
Author

@dylans you are right. It works only on first word and also if i select word by draging cursor, then it works. But i think this is a issue because it is not very user friendly. If you want mark multiple words or whole sentence, then dragging is okay, but for one word, i think more preferred way to select is just double click. What do you think?

@dylans
Copy link
Collaborator

dylans commented Jan 19, 2022

@matobiely I didn't close/reject your report because it is an issue. 😂 ... just added notes to help clarify/track it down. Edges/boundaries are one of the things that is challenging to get right across platforms. For example, see the discussion in #4522 or #4588.

@bryanph
Copy link
Contributor

bryanph commented Jan 26, 2022

We don't seem to have a concept for unhanging selections w.r.t inlines/texts it seems. Introducing this as was suggested here would solve this I think.

Another way might be to unify the "double-click to select" behavior across browsers so that the resulting selection is not hanging (is this something we can hook into?)

@bryanph
Copy link
Contributor

bryanph commented Jan 26, 2022

Also looks like #3336 tracks the same issue

@dylans
Copy link
Collaborator

dylans commented Mar 20, 2022

Duplicate of #3336.

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

No branches or pull requests

3 participants