How do I hide empty option values with classes?
What is the current behavior?
My empty value tags still appear in the ui.
You might consider using the removeOption method on the widget. The options that are rendered are li tags not option tags. The widget just uses the option tags from the original select to build the list before the widget takes the place of and hides the underlying select.
Otherwise you might try using css to hide li tags with no text that are under the ui-multiselect-checkboxes css class.
You might consider using the
removeOptionmethod on the widget. The options that are rendered arelitags notoptiontags. The widget just uses theoptiontags from the original select to build the list before the widget takes the place of and hides the underlyingselect.Otherwise you might try using css to hide
litags with no text that are under theui-multiselect-checkboxescss class.
Otherwise you might try using css to hide li tags with no text that are under the ui-multiselect-checkboxes css class.
This seems my best option I didn't know it rendered in li tags. So the css would then be ui-multiselect-checkboxes li[value=""] {display: none'}
If you inspect the HTML on the demo page, it's not the li that has a value but the input tag underneath it. You'd end up with a selector like 'li input[value=""]'. That selects the checkbox though. You would need some JavaScript to hide the parent based on that since I don't think css has a parent selector.
Something like: document.querySelectorAll('li input[value=""]').forEach((el) => el.closest('li').className = "hidden")