Installed version: 2.2.1
I have the following dropdown configuration:
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.
Clicking the item is not doing anything, but moving around with the keyboard works.
When I remove the 'select' action it works, but it changed the selected text.
Can you create a JSFiddle?
There were significant dropdown changes and I want to make sure everything is fine.
Clicking on the dropdown's items works fine (you get an alert).
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 :)
I've got the same issue on 2.2.1
Any updates on this issue?
The 'onChange' trigger on keyboard arrows keys seem to be intended change and you can disable it by setting new option selectOnKeydown to false. This however still doesn't change the fact, that onChange doesn't trigger on either click or enter when action == 'select'.
action == 'select'
@jlukic, any update regarding this issue?
It's blocking us for upgrading to Semantic-UI 2.2.x
Working on this now.
Fixes #4183 Fixes not working correctly since due to incorrect use of…
… new function signature.
I've fixed this for next patch release.
The issue still seems to be present in 2.2.4:
Here is my PR: #4510
@martinduparc try this one: http://jsbin.com/zitasehexi/edit?html,js,output
It works as expect... value, text and selectedItem are defined (and you can see the selected elements).
Thanks @dorsha but this isn't the behavior I am expected. The dropdown you used is multiple and I need the action to be select to retain the current text.
So just remove the multiple attribute:
Seems to work (single select + correct values are printed):
@dorsha Works well without the select action but doesn't when the option is set:
Yes, because when having the select option, the the dropdown does not change the current text.
From their documentation:
It is more likely to use the select option when you don't want the text to be changed, like in the following dropdown:
The behavior must have changed then since $selectedItem was working in v2.1. The documentation still states the following onChange(value, text, $choice) so it might be outdated?
onChange(value, text, $choice)