marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
142 stars 40 forks source link

Extra event handlers are getting added when noConflict js containing marko widgets is loaded #175

Open ctdio opened 7 years ago

ctdio commented 7 years ago

Hey, sorry to open up an issue on a legacy module, especially since v4 is already here.

I've been seeing issues with extra event handlers being added when we lazily load one of our scripts onto a page that already has marko v3 components on the page. Once the script is loaded, all button clicks on our page end up firing twice, causing some problems for our test automation team.

I managed to isolate the issue and pushed it to this repo: https://github.com/charlieduong94/marko-widgets-double-events-issue

The issue seems to be because of lasso's noConflict option. Removing the option would fix the issue for us, but because of the nature of our api, we need to have that enabled to ensure that we don't clash with any other code out in the wild.

Note: this problem only seems to be an issue with marko v3 and marko widgets. I tried to reproduce the issue with marko v4, but things seem to work fine.

(To be honest, I just want to move my team to v4, but we can't do that yet)