Semantic-UI: Single dropdown selection does not work when clicking an item and having 'select' action (version 2.2.1)

Installed version: 2.2.1

I have the following dropdown configuration:

      dropdownSelector
          .dropdown({
            fullTextSearch: true,
            preserveHTML: true,
            onChange,
            action: 'select',
            onHide: this.onHide,
            onShow: this.onShow,
            transition
          });

I am using the ‘select’ action since I don’t want the current text to be changed.

Prior version 2.2.x, it works fine. After the upgrade, the ‘onChange’ is not dispatched when clicking the dropdown item - but, it dispatched when moving around with the keyboard arrow keys.

I also tried to add allowReselection: true but it did not fix it.

Any idea?

Clicking the item is not doing anything, but moving around with the keyboard works. image

When I remove the ‘select’ action it works, but it changed the selected text.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve fixed this for next patch release.

Yes.

Semantic-UI 2.1.8: https://jsfiddle.net/no7kfus9/ Clicking on the dropdown’s items works fine (you get an alert).

Semantic-UI 2.2.1: https://jsfiddle.net/rgdb931n/ Clicking on the dropdown’s items does not trigger the onChange event (you don’t get alert). The onChange it triggered when you try to navigate with the keyboard arrows keys. (in the previous version, navigate with the keyboard keys was not triggered the onChange event)

Ignore the bad style 😃