-
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
Derive onSelectionChange
and onValueChange
from onChange
#5521
Labels
Comments
The goal is to listen to value change only, all operations except |
Ah so totally a different hook. |
The solution needs to be built exactly like
Tip: you can start from slate/packages/slate-react/src/plugin/with-react.ts Lines 363 to 367 in ff7db22
onSelectionChange if options.operation.type === 'set_selection' , else onValueChange by passing a new parameter to onContextChange to call the corresponding callback.
|
5 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
onChange
currently triggers for all changes: value and selection. When I only want to listen to value changes, this is not optimal.Solution
Keep
onChange
and addonSelectionChange
to listen to selection change only andonValueChange
to listen to value change only.Bounty: udecode/plate#2700
The text was updated successfully, but these errors were encountered: