-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
💡 Optional mutation observer for block tools #2205
Comments
I have related problem too. I write tool with map and map script update block class many times per second. So if i call |
@medzhidov and @Bobsans, I've implemented a way to disable the mutation observation, check out this PR: #2317 Also, I've created a branch that includes the This branch can be used on an
You can test it if you'd like, but I don't recommend using it in production, for obvious reasons. Either fork my feature branch and build it, or wait for my PR to (hopefully) be merged. |
@lucas-varela Okay, but current realisation is a bad: i have a vue component with a LOT of divs inside, so now i must add this attribute to EACH element. Why you just cant see for parent blocks with that attribute like this? |
You're right, it would be better to improve it like that. |
@neSpecc Created PR for this fix, added "true" as an value of attribute to make it more variable |
Sometimes it needs to stop mutation observer on blocks, because they are not created to be observed. For example, i create an custom tool block that has several logic, attributes/classes/styles and i want to save only content that i dispatched via
block.dispatchChange();
, because mutation observer trigger "didMutated" when content is not really edited (for example trigger class on image by hovering).I already solved this by edited code, so there is my suggested solution:
So now we can add in our block tool a static method and mutation will be ignored for this block:
It's 2 am so i may forget something but it works perfectly in my project now.
The text was updated successfully, but these errors were encountered: