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

[lexical] Bug Fix: mutation listener set for original node should work with the replaced node #6189

Merged
merged 3 commits into from
May 29, 2024

Conversation

StyleT
Copy link
Contributor

@StyleT StyleT commented May 28, 2024

Description

Based on the #6089 (this one adds tests)

Closes #4498

Steps To Reproduce

  1. create a custom node and replace it with node that has a mutation listener builtin .
  2. Observe that listeners won't take effect.

The current behavior
registerMutationObserver for original node won't work for the replaced node

The expected behavior
registerMutationObserver for original node should work for the replaced node

Test plan

see tests!

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 10:59pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 10:59pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 28, 2024
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 23.95 KB (0%) 480 ms (0%) 173 ms (-3.3% 🔽) 652 ms
packages/lexical-rich-text/dist/LexicalRichText.js 34.64 KB (+0.02% 🔺) 693 ms (+0.02% 🔺) 575 ms (+30.24% 🔺) 1.3 s
packages/lexical-plain-text/dist/LexicalPlainText.js 34.62 KB (+0.03% 🔺) 693 ms (+0.03% 🔺) 495 ms (-10.59% 🔽) 1.2 s

Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 23.95 KB (0%) 480 ms (0%) 487 ms (-3.07% 🔽) 966 ms
packages/lexical-rich-text/dist/LexicalRichText.js 34.63 KB (0%) 693 ms (0%) 1.3 s (-3.15% 🔽) 2 s
packages/lexical-plain-text/dist/LexicalPlainText.js 34.61 KB (0%) 693 ms (0%) 1.9 s (+42.66% 🔺) 2.6 s

@StyleT StyleT marked this pull request as ready for review May 28, 2024 23:02
Copy link
Contributor

@potatowagon potatowagon left a comment

Choose a reason for hiding this comment

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

looks good thankyou

@lexical-bot lexical-bot added the extended-tests Run extended e2e tests on a PR label May 29, 2024
@StyleT StyleT added this pull request to the merge queue May 29, 2024
Merged via the queue into main with commit 033c07a May 29, 2024
40 checks passed
@richardaum
Copy link

Is this withKlass property used for replace nodes documented?

@etrepum
Copy link
Collaborator

etrepum commented Sep 10, 2024

withKlass is used in the documentation examples now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: registerMutationListener on replaced node
7 participants