Skip to content
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

Fix move_node triggers nodes re-render (#5513) #5514

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

YaoKaiLun
Copy link
Contributor

@YaoKaiLun YaoKaiLun commented Sep 20, 2023

Description
Reset the source parent element and the target parent element of the moved node to NODE_TO_KEY, for prevent them to re-render

Issue
Fixes: #5513

Example
Using the official example https://www.slatejs.org/examples/richtext . After deleting the paragraph behide the list element, the list element's key will not change anymore.
企业微信截图_617ae87a-93ce-49af-b10a-d419d8705827
企业微信截图_a0a55074-9833-4176-86ac-c3ab4597ddff

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 Sep 20, 2023

🦋 Changeset detected

Latest commit: 40e67f0

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

This PR includes changesets to release 1 package
Name Type
slate-react 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

Copy link
Collaborator

@dylans dylans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changeset please.

A few integration tests appear to be failing, but it's unclear if this is due to this change or not.

@YaoKaiLun
Copy link
Contributor Author

YaoKaiLun commented Sep 22, 2023

Needs a changeset please.

A few integration tests appear to be failing, but it's unclear if this is due to this change or not.

@dylans The latest PR had same errors https://github.com/ianstormtaylor/slate/actions/runs/6186489569/job/16794248174

@dylans dylans merged commit ff7db22 into ianstormtaylor:main Sep 25, 2023
10 checks passed
@github-actions github-actions bot mentioned this pull request Sep 25, 2023
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.

The “move_node” operation triggers a node re-render
2 participants