WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@delijah
Copy link
Contributor

@delijah delijah commented Aug 14, 2025

Description
This PR change the toSlatePoint function in a way, that if the selection is within a contentEditable={false} node, it will search backward and forward for valid slate leafs. Before it was only looking backward by default.

Issue
Fixes: #5932

Example
You can find a GIF and a codesandbox link in the linked issue. Here you can see how it behaves after the fix:
slate-drop

Context
I am aware, that this is a very sensible spot to make changes. Help appreciated!

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@changeset-bot
Copy link

changeset-bot bot commented Aug 14, 2025

🦋 Changeset detected

Latest commit: 835b1d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate-dom Patch

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

@delijah delijah changed the title Search backward and forward for leaf nodes in non contenteditable elements FIX: Search backward and forward for leaf nodes in non contenteditable elements Aug 15, 2025
@delijah delijah changed the title FIX: Search backward and forward for leaf nodes in non contenteditable elements fix: Search backward and forward for leaf nodes in non contenteditable elements Aug 15, 2025
@delijah
Copy link
Contributor Author

delijah commented Aug 21, 2025

How shall we proceed here @12joan ?

@12joan
Copy link
Contributor

12joan commented Aug 21, 2025

How shall we proceed here @12joan ?

Apologies if I gave you the wrong impression in the other threads where we've talked, but I'm not actually a Slate maintainer. I just comment on issues and PRs from time to time when I feel my input could be helpful. 😃

@dylans is the maintainer of Slate, and will likely review this PR in due course.

@dylans dylans merged commit 0558345 into ianstormtaylor:main Aug 25, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Aug 25, 2025
@delijah
Copy link
Contributor Author

delijah commented Aug 26, 2025

Apologies if I gave you the wrong impression in the other threads where we've talked, but I'm not actually a Slate maintainer. I just comment on issues and PRs from time to time when I feel my input could be helpful. 😃

I am sorry, there was probably some desperation involved, tagging you 🙈 Thx for the reply though @12joan and thx for proceeding @dylans !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot resolve a Slate point from DOM point when dropping image on first position

3 participants