When using the option: {native: true} and then calling "refresh()" because the data has changed, the destroy function deletes the original select box by calling "self.dropdownContainer.remove()".
This can be fixed by adding the following lines in the _destroySelectBoxIt function before the "remove()" call.
if (self.options["native"]) {
self.dropdownContainer.before(self.selectBox);
}
This code will place the select box back where it started and then the rest of the code will work as intended.
When using the option: {native: true} and then calling "refresh()" because the data has changed, the destroy function deletes the original select box by calling "self.dropdownContainer.remove()".
This can be fixed by adding the following lines in the _destroySelectBoxIt function before the "remove()" call.
This code will place the select box back where it started and then the rest of the code will work as intended.