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

Visual Picker Checkbox doesn't work in Firefox when checkbox is clicked on directly #3905

Open
1 of 3 tasks
dangmai opened this issue May 13, 2024 · 2 comments
Open
1 of 3 tasks
Labels
Area: Components Related to the component library (core) of this system Fix/Change in Backlog DSYS has acknowledged this improvement and will update the thread with results when we prioritize it Type: Bug Something isn't working

Comments

@dangmai
Copy link

dangmai commented May 13, 2024

Description

In Firefox, when I click directly on a checkbox inside a Visual Picker, the selection doesn't change. The selection does change if I click on the box surrounding the checkbox.

Link to Reproduction

n/a since this is reproducible directly on Paste website

Steps to reproduce

  1. Go to https://paste.twilio.design/components/visual-picker#vertical-checkbox in Firefox
  2. Click on any checkbox in the Visual Picker.
  3. Notice that no selection is made.

Paste Core Version

20.2.0

Browser

Firefox 125.0.3

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

Copy link

dosubot bot commented May 13, 2024

The issue with the Visual Picker Checkbox not working in Firefox when clicked directly seems to stem from how Firefox handles click events on hidden input elements differently than other browsers. This discrepancy affects the VisualPickerCheckbox component in the Paste design system, particularly due to the specific event handling logic implemented for the checkbox and its surrounding box.

In the Paste design system, clicking on the surrounding box of the checkbox triggers a programmatic click on the checkbox itself, which should toggle its state. However, when clicking directly on the checkbox, Firefox's handling of the event on the hidden input element prevents the expected change in state. This is because the event propagation is stopped by the BaseRadioCheckboxControl component's onClick handler, which represents the checkbox visually.

To address this issue, the event handling logic within the VisualPickerCheckbox component may need to be adjusted. Ensuring that the click event on the checkbox icon properly triggers a change in the checkbox's checked state, even in Firefox, could involve directly toggling the state in the event handler or making sure the hidden checkbox receives the click event in a way that Firefox can handle correctly.

The relevant code can be found in the VisualPickerCheckbox.tsx file in the Paste repository. Adjusting this logic should help achieve consistent behavior across browsers, including Firefox.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added Area: Components Related to the component library (core) of this system Type: Bug Something isn't working labels May 13, 2024
@nkrantz nkrantz added the Active Discussion This discussion is still in progress label May 15, 2024
@nkrantz
Copy link
Collaborator

nkrantz commented May 15, 2024

Hey @dangmai - thanks for reporting this! I've added a ticket to our backlog to address the bug. We'll let you know here once it's fixed.

@nkrantz nkrantz added Fix/Change in Backlog DSYS has acknowledged this improvement and will update the thread with results when we prioritize it and removed Active Discussion This discussion is still in progress labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Components Related to the component library (core) of this system Fix/Change in Backlog DSYS has acknowledged this improvement and will update the thread with results when we prioritize it Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants