-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix: regression caused by triple click fix #4498
Fix: regression caused by triple click fix #4498
Conversation
Only reset the focus node of a selection when the node with attribute `data-slate-string` is defined
🦋 Changeset detectedLatest commit: 8ebf4c7 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 |
Thank you @dylans for the edit. Are the failed tests acceptable? They passed on my local machine before the addition of changeset. |
They appear to be timeouts in the CI/CD testing environment, so I’m not going to block based on that. |
Thanks for doing that quickly after it was discovered! I have a small request. This is a fix for a change that wasn't released, so it doesn't need a changeset. The original fix did need a changeset but one wasn't added. As such, your one entry in the changelog now looks a bit weird. Would you mind creating a new PR that removes this changeset and adds one for the #4455 fix? I would do it myself but then you'd lose credit. |
* fix: check if data-slate-tring node is not null Only reset the focus node of a selection when the node with attribute `data-slate-string` is defined * fix: rewrite logic for checking triple click * Add changeset Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
fixes #4490
Description
Introducing fix for triple-click selection in this PR caused some regressions that I didn't expect.
This new PR will alleviate that.
Issue
Some of the issue caused by the triple click fix include, but not limited to:
Context
There are two problems with my triple-click fix:
focusNode
of a selection is not fail-proof. The building block of the content component in a Slate editor are HTML element with attributedata-slate-node="element"
. They may contain child elementsdata-slate-string
, but not always. The current logic assumes that Element always contains String elements, which leads to the crash when selecting void nodes.Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)