-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
BUG: Component model and view inits every time it's dragged over every component present in Canvas on which it can be dropped into #6269
Comments
@artf any chance you could have a look at this? Thank you. |
@mohamedsalem401 this is probably happening due to the shallow editor. const wrapper = this.getShallowWrapper();
srcModel = wrapper?.append(source, { temporary: true })[0] || null; |
@artf |
Hello @artf, The change above, which I saw was implemented, doesn't seem to fix the behaviour I encountered. It's still the same as in version 0.22.1. Thank you. Hope you will give it another try. |
@bt-mkt |
@mohamedsalem401 Understood. I assumed it was included when I saw it was closed the same day of the last release, should have checked the release to see if the pr was indeed included. Thank you. |
GrapesJS version
What browser are you using?
Chrome Version 130.0.6723.59 (Official Build) (arm64)
Reproducible demo link
https://codepen.io/btmkt/pen/QWeOJRB?editors=1111
Describe the bug
How to reproduce the bug?
test-comp
component added at the end in theextra
category over the added components.What is the expected behavior?
The component
model
andview
init events (at least, not sure if there are others) should trigger only when dropping the component into the Canvas and not every time it's dragged above a component in which it can be dropped.What is the current behavior?
The component
model
andview
init events are triggered every time you drag it over a component it can be dropped into, and twice when dropped. This causes a lot of issues especially if for example you trigger a modal open( it will add as many modals, if not conditioned, as many timesinit
is triggered).I've created a pen for v0.21.13 (https://codepen.io/btmkt/pen/OJKOrPQ?editors=1111) also so you can see the difference, same steps to reproduce the issue apply.
I am currently on v0.21.10 which works the same as v0.21.13, from my tests at least, and would like to bump to v.0.22.1, but can't due to this new behaviour.
Please let me know if you need any other information.
Thank you.
Code of Conduct
The text was updated successfully, but these errors were encountered: