Skip to content

Unexpected auto-scrolling behavior when refocus the editor #5826

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

Open
ederzz opened this issue Mar 19, 2025 · 0 comments
Open

Unexpected auto-scrolling behavior when refocus the editor #5826

ederzz opened this issue Mar 19, 2025 · 0 comments
Labels

Comments

@ederzz
Copy link
Contributor

ederzz commented Mar 19, 2025

Description
The editor has rendered a long-text, when i make it blured, and refocus the editor it occurs a auo-scroll behavior.It is unexpected.It seems the dom-selection hasn't change when enter the code logic: code link

Recording

Image

Sandbox
https://codesandbox.io/p/sandbox/n8tm84

Steps
To reproduce the behavior:

  1. Go to sanbox
  2. Click on top line of editor
  3. Click outer, make editor blured.
  4. Scroll down to the end line of editor
  5. Click on editor, make it focused, then occurs auto-scroll

Expectation
I think the auto-scroll behavior shouldn't occur, because i have selected a new postion.

Environment

  • Slate Version: latest
  • Operating System: MacOs
  • Browser: Chrome

Context
After reading the source code, i found that when the code runs into function setDomSelection, neither the Slate selection nor the DOM selection updates to where I clicked.

@ederzz ederzz added the bug label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant