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

Tunes with wrappers aren't calling didMutated, when changing tune value #2691

Open
VelssLacis opened this issue Apr 20, 2024 · 0 comments
Open
Labels

Comments

@VelssLacis
Copy link

Creating a custom tune, if a wrapper element is used, it will not call didMutated, and because of it, onChange is also not called.
Issue comes from v2.27.0-rc.5 : b7b00fd#diff-3a2e107229dbebf0e0b7e00160e7faec0cf71e6baf51872078e031789692c8b5R934

On data mutation, it will check if block element contains the mutated wrapper tune element, and will always fail, as it is a wrapper, and not a child of the block.

kaaaaaaaaaaai/editorjs-alignment-blocktune#12
kaaaaaaaaaaai/editorjs-alignment-blocktune#13

Steps to reproduce:

  1. Create a tune with a wrapper element / install editorjs-alignment-blocktune mentioned above
  2. Try setting a tune for the block
  3. onChange is not called

Expected behavior:
if this is intended, should all tunes use dispatchChange() on tune change starting from v2.27.0-rc.5?
if not, then, I think the onChange should be called regardless if mutated element is part of a block. (E.g. What happens if there is some button outside of EditorJS container, that would, change a tune for all blocks (backgrounds, alignments, etc.)?)

Screenshots:
image
The ce-tune-alignment--center is the tune wrapper element, and ce-paragraph is the block element, didMutated will not be called whenever wrapper is mutated, as it is not part of block element.

Device, Browser, OS: any

Editor.js version: v2.27.0-rc.5 and above

Plugins you use with their versions:
https://github.com/kaaaaaaaaaaai/editorjs-alignment-blocktune 1.0.3

@VelssLacis VelssLacis added the bug label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant