We're facing an issue with a popup that contains a form consisting of several <select> tags. Sometimes, these <select> elements appear on the page without any specified <option> tags and are filled in later on. Some already have predefined <option>s. In all scenarios, there is a possibility of adding or removing <option>s from the <select> elements. Currently, we are integrating Semantic UI to define these <select> tags as shown below:
<select id="select1" class="ui dropdown"></select>
The challenge we're encountering is that the created dropdowns (referred to as "menu") are not getting updated when changes occur in the underlying <select> element. Is there a specific function that needs to be invoked when adding or removing <option>s?
UPDATE: In an attempt to address this issue, I tested the following:
$('#select1').dropdown('refresh')
Unfortunately, the semantic UI menu did not reflect any updates.
UPDATE 2 It's worth noting that in some instances, the <option>s are toggled by changing their display property to none instead of physically removing them from the <select> tag. Conversely, in other cases, they are indeed added or removed from the list. Can Semantic UI effectively handle both of these scenarios?