brianvoe / slim-select

Slim advanced select dropdown
http://slimselectjs.com
MIT License
1.03k stars 195 forks source link

New instance with data property triggers original select change event #525

Closed pepa-linha closed 6 months ago

pepa-linha commented 6 months ago

If I create a new instance of SlimSelect and pass data, then the change event on the original select is fired. This doesn't seem like the correct behavior to me because I'm not making any changes on original select neither SlimSelect instance.

https://github.com/brianvoe/slim-select/blob/develop/src/slim-select/index.ts#L135

Then the trigger in updateOptions is fired.

Would it be possible to suppress the firing of this event in this case?

brianvoe commented 6 months ago

Sorry im not fully convinced this is an issue. Plus i have no idea what your setup is cause you didnt give me any working code to look at, ill repaste the issue template below so you can see again what i ask when you fill out an issue.

If your original select is empty and you pass data, the data will fill out the select thus updating it to a new value. Thus the firing of the change event.

Recreate it in Codepen If I cant see the issue I will not look at the issue. https://codepen.io/brianvoe/pen/MWXqXXV