-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
marks on double click selection using firefox fix #5580
Conversation
🦋 Changeset detectedLatest commit: a58c546 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Can you add a unit test for the case that affects Firefox, and add a changeset?
I tried to add one, i hope i did it the right way :D |
I think this change should be a |
Thanks for making those changes. Did you want to add a unit test? |
IDK how to make them the right way.. |
If you grant me commit access to your fork, I can add one later today. 🙂 |
done ! |
Thanks. I've added the test. |
The integrations test failures are unrelated to this PR and can be safely ignored |
Wow, awesome! Thank you for working on a fix for my issue. I had really wanted to use Slate but this was a blocker for me, so I started exploring alternatives -- now I can go back to slate! :D |
Description
This PR contains a quick-fix of marks function using Firefox. This was already fixed, but the fix was removed inside of #5486. I put it back but this time only in marks code instead of selection handling one, so it should not affect anything else.
Issue
Fixes: #5574 #5560
Example
Before the fix:
When fixed:
Context
This is related to firefox weird selection range when double clicking.
Explanation from original fix:
* suppose we have this document:
*
* { type: 'paragraph',
* children: [
* { text: 'foo ' },
* { text: 'bar' },
* { text: ' baz' }
* ]
* }
*
* a double click on "bar" on chrome will create this range:
*
* anchor -> [0,1] offset 0
* focus -> [0,1] offset 3
*
* while on firefox will create this range:
*
* anchor -> [0,0] offset 4
* focus -> [0,2] offset 0
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)