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

Missing focus states/events for radio buttons in VPN-support dialog #22631

Open
stephendonner opened this issue Apr 29, 2022 · 10 comments
Open

Comments

@stephendonner
Copy link

Description

Missing focus states/events for radio buttons in VPN-support dialog

Steps to Reproduce

  1. install 1.39.86
  2. launch Brave
  3. set up VPN on development env for the SKUs SDK (lots of separate steps)
  4. click on the VPN icon
  5. click on the location
  6. press tab / shift+tab (reverse) to try to cycle through the radio buttons of the elements

Actual result:

Radio button controls are not in the tabindex and are skipped

no-tabindex-radio-buttons

Expected result:

Each element and their radio-button control should be tab-focusable/have a focus ring

Reproduces how often:

100%

Brave version (brave://version info)

Brave 1.39.86 Chromium: 101.0.4951.41 (Official Build) beta (x86_64)
Revision 93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}
OS macOS Version 11.6.5 (Build 20G527)

@bsclifton @aguscruiz @nullhook

@stephendonner stephendonner added bug needs-text-change This change requires some careful wording. QA/Yes QA/Test-Plan-Specified OS/Desktop feature/vpn and removed needs-text-change This change requires some careful wording. labels Apr 29, 2022
@rebron rebron added the priority/P4 Planned work. We expect to get to it "soon". label May 19, 2022
@GeetaSarvadnya
Copy link

++reproduced on window 10 x64

@spylogsster
Copy link

works for me, @GeetaSarvadnya @stephendonner could you recheck pls?

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jun 21, 2022

Looks like the issue is fixed and working fine on Windows 10 x64 - Brave version 1.41.74. I have tried both the Tab and shift+tab to cycle through the radio buttons, and I could see the focus ring around the selected radio button.

VPN radio button focus ring

@stephendonner
Copy link
Author

works for me, @GeetaSarvadnya @stephendonner could you recheck pls?

Not working for me, see below.

@stephendonner
Copy link
Author

Looks like the issue is fixed and working fine on Windows 10 x64 - Brave version 1.41.74. I have tried both the Tab and shift+tab to cycle through the radio buttons, and I could see the focus ring around the selected radio button.

VPN radio button focus ring VPN radio button focus ring

Thanks for taking a look @GeetaSarvadnya. Even in this video, we can see that the radio buttons themselves are only selectable/tab-able via the mouse. Keyboard operations work but only the country labels get a focus ring.

IMHO (back me up @aguscruiz!) there should be a focus ring on the radio buttons, same as there currently is for the country labels' controls.

@stephendonner
Copy link
Author

(The radio buttons clearly have a selected state, but not the focused one I'd expect from tabing.)

@bsclifton
Copy link
Member

cc: @fallaciousreasoning in case this was an interesting one for possible Nala cleanup 🙂 Problem is with the keyboard shortcut usage - it's not treating the radio button as linked to the label (like it was one cohesive control).

@fallaciousreasoning
Copy link

How are these buttons laid out? Because keyboard controls work nicely in our test page:

Screencast.from.2024-02-26.09-23-01.webm

Is there a chance you're using them inside another label?

<label>
  <LeoRadiobutton/>
  Foo
</label>

The radiobutton already has a label inside it, so correct usage would be:

<LeoRadiobutton>Foo</LeoRadiobutton>

@fallaciousreasoning
Copy link

Oh wait, this isn't actually using the Nala radio buttons at all. I could migrate it over, but I'm on Linux so I don't have the VPN. Should be something like this though:

import RadioButton from '@brave/leo/react/radiobutton'

// ...


{regions.map(r => <RadioButton key={r.countryIsoCode} name="region" value={r.countryIsoCode} selectedValue={currentRegion?.countryIsoCode} onChange={e => setSelectedRegion(r)} />

@bsclifton
Copy link
Member

That is correct (this is not using Nala... yet). It would be great to add - but that's right, you're on Linux 😂

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

6 participants