dbrekalo / fastselect

Fastselect is lightweight browser plugin for enhanced select elements based on jQuery. Enables fast and sensible UI upgrade of select element with features like option searching and remote dataset loading.
http://dbrekalo.github.io/fastselect/
MIT License
108 stars 87 forks source link

The destroy is function private and does not seem to be used #49

Open bseddon opened 5 years ago

bseddon commented 5 years ago

When used inside a JQuery dialog it can be important to tidy up when the dialog is closed. Fastselect does implement a 'destroy' function but, perhaps because it is not implemented as a widget, this function is not called so the plugin does not tidy up the extra HTML it adds to the page.

It will be great if the destroy function can be exposed.

In the meantime, here is a hack to invoke the function and tidy up:

var elements = jQuery(''); elements.each(function() { jQuery.data(this, 'fastselect').destroy(); }); elements.prop('selectedIndex', -1);

kcorn850 commented 1 year ago

Man, this really needs to be fixed. Damn control values stick even if you change the select values directly in the dom.