mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-02 16:04:07 +03:00
avoid preventing input event onclick (#30992)
* instead of stopping event if onclick is triggered on input, call toggle method only if its not on checkbox inside a label * add unit test * add a dedicated test to ensure click event is forward to label Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
+2
-3
@@ -153,10 +153,9 @@ $(document)
|
||||
return
|
||||
}
|
||||
|
||||
if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
|
||||
event.preventDefault() // work around event sent to label and input
|
||||
if (initialButton.tagName !== 'LABEL' || inputBtn && inputBtn.type !== 'checkbox') {
|
||||
Button._jQueryInterface.call($(button), 'toggle')
|
||||
}
|
||||
Button._jQueryInterface.call($(button), 'toggle')
|
||||
}
|
||||
})
|
||||
.on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||
|
||||
Reference in New Issue
Block a user