Semantic-UI: [Dropdown] - Error behavior "setup menu"
Steps to Reproduce
$('#selectID').dropdown('setup menu');
Expected Recreates dropdown menu from select option values.
Result
In Console:
Uncaught TypeError: Cannot read property 'values' of undefined
Testcase http://jsfiddle.net/agvg0L3j/1/
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 15 (3 by maintainers)
Having massive issues with the dropdown module and API as a whole, seems very inconsistent in the current build.
setup menu
while undocumented, actually requires an argument with a structure such as this:Alternatively, replacing the entire html of
<select>
should cause the dropdown observer to re-render the dropdown module, updating selected value from the new<select>
html. It does not update the text tho, for whatever reason. Also it looks like when callingsetup menu
it actually re-renders twice, not once.I’m also finding that when using a dropdown that has had
setup menu
used on it any subsequent calls of.dropdown('get text')
work as expected but.dropdown('get value')
returns null - anyone else had this… got a fix?Not sure if the documentation should be changed, or the behavior of
setup menu
should be changed—the documentation states that the method “recreates dropdown menu from selectoption
values”; I’m assuming any changes to a hiddenselect
should be reflected in an actual dropdown aftersetup menu
is called, does that sound right?Why should one put those values again?
How can one re-initialise the dropdown on a select after complete overwriting the dropdown with Ajax?