Open kurthamilton opened 2 months ago
Thank you for your submission.
Most likely if anything I would return a second value to afterChange some sort of difference value.
If you want to put together a pr Ill get it in.
Thanks.
Thanks @brianvoe. I'll look at putting something together. I have another feature request / idea as well. Is it always best to open an issue first?
ya maybe figuring out what your trying to do and making sure it make sense before submitting a pr might be best.
But also I have merged in people's stuff and all they did was submit a pr
Use case
I am displaying a long list of ordered options, allowing users to add their own values via the
addable
event. After a new item is added I would like to re-order the options in the dropdown.Current workaround
I am currently storing the original state, and then on every
afterChange
event comparing the new values with the original values and re-creating the slim select instance.This not only results in a flash of no content while re-creating slim select, but also a lot of boilerplate.
Suggested solution
added
event that fires after the DOM has been updatedrebuild
method (or observe DOM mutations) that rebuilds the slim select list from the DOM