Skip to content

JS - button plugin stop event propagation on checkboxes/radio when browsing with keyboard #28564

@Lausselloic

Description

@Lausselloic

After looking at the previous issue #26904

And play with the associated codepen : https://codepen.io/Johann-S/pen/GBqoZG?editors=1111

I could still reproduce the use-case in current documentation on 3 way radio toggle buttons :
https://getbootstrap.com/docs/4.3/components/buttons/#checkbox-and-radio-buttons

1 - browse the input element with keyboard
2 - change the selected item using keyboard arrow
3 - look in the console document.getElementById('option2').checked or other optionid the current value isn't the visual one

Works well when using mouse

My first tests :

  • $(input).trigger('change') is well executed with keyboard or mouse but maybe there's sub-jascent events to propagate?
  • by removing the event.preventDefault() from plugin initialisation state change well with keyboard
$(document)
  .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {
    // event.preventDefault()

First tests doesn't show anything is broken by removing this

image

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions