Closed umaraziz0 closed 1 month ago
@umaraziz0 Hi, Thank you for bringing this to our attention, we're appreciate it! As far as I can see this error doesn't affect functionality and you can continue to use this functionality despite the error in the console. We will fix this in the next update. Best regards!
Have the same probleme! Preline version: 2.4.1
Find a solution to this problem by using try catch construct. So in catch we can handle errors and in finally continue executing the code!
const endMinutesSelect = HSSelect.getInstance('#minutesEnd');
try {
endMinutesSelect.removeOption(optionsToDelete)
} catch (error) {
} finally {
endMinutesSelect.addOption(newOptions);
}
Hey @umaraziz0 - please check the latest version, the issue has been fixed. Thanks!
Summary
Advanced Select add & remove options don't work after update
Steps to Reproduce
Tried using the example component in the docs
Demo Link
https://preline.co/docs/advanced-select.html#add-remove-options
Expected Behavior
removeOption
should work as intended.Actual Behavior
val
values andfalse
Uncaught TypeError: Cannot read properties of null (reading 'length')
and doesn't do anything else.Seems to occur in single select dropdowns, the multiple select example in the docs has no issue.
This also happens in one of my projects, when I tried upgrading the package version due to this bug: https://github.com/htmlstreamofficial/preline/issues/414 , where in my case no items are removed.
Preline version: ^2.4.1 Chrome version: Version 126.0.6478.185 (Official Build) (arm64)
Screenshots