Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace deprecated DOMNodeInserted listener with MutationObserver - #44

Merged
bobvandevijver merged 8 commits into
bolt:masterfrom
Thibault-MTZ:patch-1
May 27, 2025
Merged

bobvandevijver merged 8 commits into
bolt:masterfrom
Thibault-MTZ:patch-1

Conversation

@Thibault-MTZ

Copy link
Copy Markdown
Contributor

Replace deprecated DOMNodeInserted listener with MutationObserver

  • Resolve Chrome incompatibility when adding collection items or other dynamic nodes
  • Restore cross-browser support (Chrome, Mozilla, etc.)
  • Future-proof DOM mutation handling

Replace deprecated DOMNodeInserted listener with MutationObserver
- Resolve Chrome incompatibility when adding collection items or other dynamic nodes  
- Restore cross-browser support (Chrome, Mozilla, etc.)  
- Future-proof DOM mutation handling
@Thibault-MTZ Thibault-MTZ changed the title Update injector.html.twig Replace deprecated DOMNodeInserted listener with MutationObserver May 20, 2025
@bobvandevijver

Copy link
Copy Markdown
Member

Thanks for your PR! Can you please update your changes so that only what needs to be changed is actually changed?

@Thibault-MTZ

Copy link
Copy Markdown
Contributor Author

@bobvandevijver
I just adjusted as requested, I think it will be better.

Comment thread templates/injector.html.twig Outdated
Comment thread templates/injector.html.twig Outdated
Comment thread templates/injector.html.twig Outdated
Comment thread templates/injector.html.twig Outdated
Comment thread templates/injector.html.twig Outdated
Comment thread templates/injector.html.twig Outdated
Thibault-MTZ and others added 3 commits May 26, 2025 21:23
Co-authored-by: Bob van de Vijver <[email protected]>
Use MutationObserver, rename observer

- Replace `DOMNodeInserted` with `MutationObserver` for better performance.
- Rename observer to `observerArticle` to prevent naming conflicts.
- Initialize editor on page load and for dynamically added nodes.
@Thibault-MTZ

Copy link
Copy Markdown
Contributor Author

@bobvandevijver Is it okay for you regarding the last commit?
Sorry for the inconvenience, I've just started using Git and GitHub again ;)

@bobvandevijver

Copy link
Copy Markdown
Member

Thank you!

@bobvandevijver
bobvandevijver merged commit 67a4857 into bolt:master May 27, 2025
@Thibault-MTZ
Thibault-MTZ deleted the patch-1 branch May 27, 2025 10:45
@Thibault-MTZ
Thibault-MTZ restored the patch-1 branch May 27, 2025 10:45
@Thibault-MTZ
Thibault-MTZ deleted the patch-1 branch May 27, 2025 10:45
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.

2 participants