-
Notifications
You must be signed in to change notification settings - Fork 11
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
Decorator Core Plugin is executed twice if gondel is present in multiple js files #48
Comments
Why should you even include gondel multiple times? Just want to figure out the environment of this issue .. |
I knew that question will come.. ;-) imagine nitro with some prototype js including a button to trigger an overlay on it's demo page..the button was done as gondel component and included in the proto.js entrypoint..that leads to it containing a second gondel core.. Of course the button could be done as plain js which also works.. |
…different js files BREAKING CHANGE: enhances structure of pluginEvents object to track if a plugin (in another js file) has already been initialized closes issue #48
…different js files BREAKING CHANGE: enhances structure of pluginEvents object to track if a plugin (in another js file) has already been initialized closes issue #48
…different js files BREAKING CHANGE: enhances structure of pluginEvents object to track if a plugin (in another js file) has already been initialized closes issue #48
Type of issue
The issue refers to:
Expected behavior
Loading the gondel core library multiple times should still trigger a click event only once per click.
Current behavior
If the gondel core library is loaded multiple times a click event is fired multiple times for a single click.
The reason for this bug is the GondelDecorators plugin which hooks itself multiple times in the start event.
There is already a code which tries to prevent this bug however it uses a local variable which will not prevent the bug if gondel is included in multiple different files:
https://github.com/namics/gondel/blob/b00e01157f11b8eb886f6b11d4d8f22d02d00bb3/packages/core/src/GondelDecorators.ts#L23
Steps to reproduce the behavior
Possible solution:
Use a global window variable instead of a local variable
The text was updated successfully, but these errors were encountered: