Closed bmcorum closed 3 years ago
Initializing multi does not check to see if the number of preselected options matched the passed in limit.
Example:
I am editing an existing record and thus my form loads with the following select HTML
<select id="multi" multiple="multiple"> <option selected="selected">one</option> <option>two</option> <option selected="selected">three</option> <option>four</option> </select>
When calling
multi(document.getElementById('multi'), { limit: 2 });
It initializes and I am able to select more than two options. If I select a third and then remove one of my options the limit will be triggered. Looks like the initialize function do not check for limit reached like the toggle_option function does.
Initializing multi does not check to see if the number of preselected options matched the passed in limit.
Example:
I am editing an existing record and thus my form loads with the following select HTML
When calling
multi(document.getElementById('multi'), { limit: 2 });
It initializes and I am able to select more than two options. If I select a third and then remove one of my options the limit will be triggered. Looks like the initialize function do not check for limit reached like the toggle_option function does.