Many sleek:open events per click in single page application
Expected Behavior When I register an event listerner via window.document.addEventListener('sleek:open', ...), exactly one event is dispatched when the widget is opened. Current Behavior When I navigate my single page application causing N pushstate/popstate events, the event is dispatched N+1 times when the widget is opened. Possible Solution The Sleekplan widget script should not re-register click events for elements with data-sleek attribute on each pushstate event. Steps to Reproduce Place a data-sleek element on your page Register an event listener for sleek:open Load the Sleekplan JS SDK Trigger multiple pushstate events Get multiple invocations of the event listener Context (Environment) I used the event to report analytics data and started seeing absurd widget open rates per user. As a workaround I now remove that data-sleek attribute in a sleek:init event handler.