Search code examples
javascriptsemantic-ui

Semantic UI multiple select dropdown - close event


I am trying to get the values selected in a multiple select dropdown - just once, because I am populating a cascading dropdown depending on the selected values in the original dropdown, and don't want to get data every time the user selects one value from the multiple select. Ideally I want to get the values after closing down the dropdown by clicking out of the dropdown or on the down arrow on the dropdown.

Does anyone know if there is an event for this? After searching online, I tried onClose, but that apparently is for React only, and also is not in the documentation.


Solution

  • I have been looking for an answer since posting the question, and yes, I found a solution.

    Using onHide, the values can be captured just once.

                $('#ddlMultiple').dropdown(
                    {
                            onHide : function () {
                              //get the selected values here
                            }
                    }
                );