Closed naumcei closed 1 month ago
There is a bug on dropdwon select, Please note that the removeOption is calling the setOption
removeOption
setOption
In latest version 2.4.1
public removeOption(values: string | string[]) { const removeOption = (val: string, isArray = false) => { const hasOption = !!this.selectOptions.some( (el: ISingleOption) => el.val === val, ); if (hasOption) { this.removeSelectOption(val, isArray); this.destroyOption(val); this.destroyOriginalOption(val); if (this.value === val) { this.value = null; this.eraseToggleTitle(); this.eraseToggleIcon(); } } }; if (Array.isArray(values)) { values.forEach((val) => { removeOption(val, this.isMultiple); }); } else { removeOption(values, this.isMultiple); } this.setNewValue(); }
The is a bug in the function
private setNewValue() { if (this.mode === 'tags') { this.setTagsItems(); } else { console.log(); if (this.value.length) this.toggleTextWrapper.innerHTML = this.stringFromValue(); else this.toggleTextWrapper.innerHTML = this.placeholder; } }
preline.js?v=d33b9117:4419 Uncaught TypeError: Cannot read properties of null (reading 'length') at _HSSelect.setNewValue (preline.js?v=d33b9117:4419:22) at _HSSelect.removeOption (preline.js?v=d33b9117:4613:10)
\
No response
@naumcei Hi, Thanks for reporting this. We fixed it in version 2.5.0, please update. Let us know if you have any issues with this.
Summary
There is a bug on dropdwon select, Please note that the
removeOption
is calling thesetOption
Steps to Reproduce
In latest version 2.4.1
The is a bug in the function
Demo Link
\
Expected Behavior
No response
Actual Behavior
No response
Screenshots
No response