Open amlan-sw opened 1 month ago
This pull request introduces two new methods, setValue and getValue, to the NiceSelect class. The setValue method allows for programmatically setting the value of the select element, while the getValue method retrieves the current value. Additionally, the handling of selected options has been improved in the _onItemClicked and resetSelectValue methods to ensure more robust manipulation of the 'selected' attribute.
Files | Changes |
---|---|
src/js/nice-select2.js |
Enhanced the NiceSelect class with new methods for setting and getting the value of the select element, and improved the handling of selected options. |
instance.setValue(newVal)
source SELECT tag will also change its value and highlight following newVal
currentVal = instance.getValue()
Summary by Sourcery
Add methods to set and get the value of the select element, enhancing the functionality to support both single and multiple selections.
New Features: