New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 846135 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 13
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Clean up views radio button keyboard controls

Project Member Reported by tbergquist@chromium.org, May 23 2018

Issue description

Unlike every other member of the Button inheritance hierarchy, RadioButton notifies its ButtonPressed listener when it receives focus.  This is necessary in order to support selecting radio buttons within a group using the arrow keys (see https://bugs.chromium.org/p/chromium/issues/detail?id=841202).

There are several problems with this setup:
- RadioButton has to manufacture a synthetic ui::event in this case.
- listeners have to listen to each radio button in a group separately, which really never makes sense - listeners will always care about a whole radio group, never about an individual button.
- events are generated in cases when there is no change in state (i.e. when an already-selected radio button receives focus or is clicked)

Cleanup options:
- Remove the event field from the callback; it's almost never used, so it might be easy to fix the few users affected (edit: no can do, it has several meaningful usecases)
- Choose a synthetic event that is in some sense 'better'
- Somehow pipe through the keyboard event that precipitated the change in focus, and use that
- Have RadioButton fully take control of its notifications instead of delegating some cases to its base classes; could use a separate notification mechanism in that case
- Pull RadioButton out of the hierarchy somehow; not sure what this would look like
- Reify the notion of a radio button group, s.t. it wraps a group of radio buttons and provides listeners with a more directly useful event to listen on
 
Description: Show this description
Description: Show this description
Status: Fixed (was: Assigned)
I just ended up removing radio button listening entirely, which has worked out pretty well.  No more action needed here.

Sign in to add a comment