-
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
ReactEditor.focus triggers onValueChange unexpectedly #5672
Labels
Comments
5 tasks
Before this issue is resolved, I think you can use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Playground: https://codesandbox.io/s/api-focus-triggers-onvaluechange-dlsfxx?file=/src/App.tsx:962-975
for a simple
<Slate />
, mannually focus / blur using cursor does not trigger itsonValueChange
event.However if using
ReactEditor.focus(editor);
,onValueChange
event is triggered (and only for the first call, weirdly).Recording
![20240704170143_rec_](https://private-user-images.githubusercontent.com/23229760/345767007-cb6e4b04-d481-4d3b-aad4-43cac1a493fb.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNTkxMDUsIm5iZiI6MTcyMzA1ODgwNSwicGF0aCI6Ii8yMzIyOTc2MC8zNDU3NjcwMDctY2I2ZTRiMDQtZDQ4MS00ZDNiLWFhZDQtNDNjYWMxYTQ5M2ZiLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA3VDE5MjY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmNzdjNGM0Nzk2MzU0OGQzZDEwOTMwMTFmZWMyOGExMTBhNDgwOWQxNzRiNjk1Y2QxMjAzODQ2MWE5YTRmNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uu7SD_4zKArg5CIYdaWlw4Ni8Ve66QXQVbSGuNdLM8M)
Sandbox
https://codesandbox.io/s/api-focus-triggers-onvaluechange-dlsfxx?file=/src/App.tsx:962-975
Steps
To reproduce the behavior:
Expectation
A consistent behavior (i.e., either both mannually focus and api focus triggers the onValueChange event, or neither does, which I guess is more reasonable.
Environment
The text was updated successfully, but these errors were encountered: