-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Checkbox] Support onChange for cursor keynav #295
[Checkbox] Support onChange for cursor keynav #295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You can change the value of a radio box with the keyboard even if Option 2 is "disabled": |
…not allow to be checked
@ColinFrick 😮 That was quite challenging, but keynav is now stopped if next option does not allow to be checked or current option does not allow to be unchecked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering why all checkboxes weren't running... then I saw I was dumb 😐
LGTM
The keypoint here is, that this PR basically fixes a very old behavior in SUI: According to the docs the behaviors `set checked|unchecked|enabled|disabled|determinate|indeterminate` are not supposed to run callbacks. But they actually always did (!) They ever since triggered the `change event`, but it never had any impact, just because the module itself did not have any `onChange` event until #295 That said, in conclusion the onchange event was now called twice: In the `set` methods aswell as in the `module` methods. 😞 The onChange event has to be kept, otherwise the keynav will not notify any change to the event system, so i removed the (wrong) event triggering in the above mentioned behavior functions and put them outside instead. In addition i also hotfixed #295, because the beforeChecked/Unchecked methods were not called correctly Closes #399, #400
Description
Changing Radio-Button Selections via Cursor Key-Navigation was not triggering the onChange Event
Testcase
Unfixed
https://jsfiddle.net/n9sLf81w/
Fixed
https://jsfiddle.net/ujkdreqs/
Closes
Semantic-Org/Semantic-UI#6676