Sleekplan Logo
we run on Sleekplan

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 1. Place a data-sleek element on your page 2. Register an event listener for sleek:open 3. Load the Sleekplan JS SDK 4. Trigger multiple pushstate events 5. 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.