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

Switch button firing change event 3 times in BS 4.5.0 #30924

Closed
dkwebtec opened this issue May 29, 2020 · 9 comments
Closed

Switch button firing change event 3 times in BS 4.5.0 #30924

dkwebtec opened this issue May 29, 2020 · 9 comments

Comments

@dkwebtec
Copy link

I have tried this issue under version 4.5.0 and the method seems working but the change event is fired 3 times on each button click

https://codepen.io/DK568/pen/MWYxWMO

try to click the button

Originally posted by @dkwebtec in #30077 (comment)

@XhmikosR
Copy link
Member

/CC @Lausselloic since it's your patch :)

@XhmikosR
Copy link
Member

XhmikosR commented Jun 9, 2020

@Lausselloic is this the same issue as #30849?

@Lausselloic
Copy link
Contributor

it's not the same issue but yes event is propagate to childrens inside the label. I could give a try to handle that

@XhmikosR
Copy link
Member

@Lausselloic please do so, thanks!

@mdo
Copy link
Member

mdo commented Aug 3, 2020

#31000 targets v4-dev, but what about this change in v5?

@XhmikosR
Copy link
Member

@Lausselloic can you confirm please that this issue does not affect v5? I believe we removed most of the Button JS so this doesn't seem to apply to v5.

@Lausselloic
Copy link
Contributor

Lausselloic commented Oct 1, 2020

Sorry for the late reply, that doesn't affect v5 at time, there's a need to backport @patrickhlauke fixes (#28952 and #28834) those accessibility fixes are not present's in v5 I will give a try to port it.

[UPDATE]
But following @MartijnCuppens commit (1a0a085) looks like there's no more js needed in v5.

Looks like V5 version is usable with keyboard successfuly https://v5.getbootstrap.com/docs/5.0/forms/checks-radios/#toggle-buttons and using label with for attribute instead of input inside the label will prevent multiple events

@MartijnCuppens
Copy link
Member

Yup, the v5 implementation is just superb 😛

@XhmikosR
Copy link
Member

XhmikosR commented Oct 2, 2020

Fixed by #31000, thanks @Lausselloic!

@XhmikosR XhmikosR closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants