Skip to content
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] Call onChange only once and dont at all on "set checked" (and others) #403

Merged
merged 2 commits into from
Jan 28, 2019

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Jan 17, 2019

Description

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

Testcase

#399
https://jsfiddle.net/7vjLsr1f/

#400
https://jsfiddle.net/3sbreo71/

Closes

#399
#400

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews labels Jan 17, 2019
@lubber-de lubber-de added this to the 2.7.2 milestone Jan 17, 2019
Copy link
Member

@ColinFrick ColinFrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami merged commit be68e1c into fomantic:develop Jan 28, 2019
@y0hami y0hami removed the state/awaiting-reviews Pull requests which are waiting for reviews label Jan 28, 2019
@y0hami y0hami mentioned this pull request Feb 4, 2019
@lubber-de lubber-de deleted the fix/399/checkbox_change_twice branch February 5, 2019 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants