-
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
Add onSelectionChange
and onValueChange
in Slate React component
#5526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR, I've added a few suggestions then it should be complete
}) | ||
await act(async () => Transforms.insertText(editor, 'Hello word!')) | ||
expect(onValueChange).toHaveBeenCalled() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add
expect(onChange).toHaveBeenCalled()
expect(onSelectionChange).toHaveBeenCalled()
And another test using Transforms.setNodes
that should not change selection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a unit test case using Transforms.setNodes
to set the text as bold. Is that okay?
Thank you for your suggestion. I will make the changes as soon as possible |
Add more unit tests.
onSelectorChange
and onValueChange
in Slate React componentonSelectionChange
and onValueChange
in Slate React component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Description
Add
onSelectionChange
andonValueChange
in Slate React componentIssue
Fixes: #5521
/claim udecode/plate#2700
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)