open-ui icon indicating copy to clipboard operation
open-ui copied to clipboard

listbox: Should selection follow focus?

Open josepharhar opened this issue 2 years ago • 3 comments
trafficstars

In this issue, we decided that selection should not follow focus in <selectlist>'s listbox: https://github.com/openui/open-ui/issues/742 In this comment, @scottaohara pointed out that maybe selection following focus is useful? https://github.com/openui/open-ui/issues/896#issuecomment-1781114197

Is there an ARIA recommendation for this? Should we provide an attribute or something to switch behaviors? Should we make selection not follow focus for <selectlist> but make selection follow focus for all <listbox>es which are not used in a selectlist?

josepharhar avatar Oct 26 '23 20:10 josepharhar

My gut here is selection also shouldn't follow focus for the same reasons it shouldn't in selectlist. It would also be unfortunate to have a disparity between the two.

As you say it'd be interesting to see any aria guidance on this, on the understanding that because this is something novel their recommendation may not be fully applicable.

lukewarlow avatar Oct 27 '23 20:10 lukewarlow

@lukewarlow if we are doing something truly novel, then a “listbox” we would not be making :)

briefly, as I have another thread started for this topic I’m not ready to merge here, yet. But so long as there is a select element that also can be exposed as a listbox (select size=+1), where it presently and has for decades had selection follow focus (which is the only guidance you’d get from aria btw, follow the host language / platform behavior) then the argument that we should be consistent is already being broken by having selection not follow focus.

sorry there is more to my thought process than this, I can expand on that later. But if consistency is key, then we need to acknowledge we are making something different, and maybe that’s ok. / frees us up to do different things. Like being novel ;)

scottaohara avatar Oct 27 '23 22:10 scottaohara

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

github-actions[bot] avatar Apr 25 '24 00:04 github-actions[bot]

Per chromium's current prototyped behaviour here, in base appearance mode selection does not follow focus and this makes for a much more usable control imo. Is this issue closable or does it need more discussion? I think most discussion has been happening in the select multiple usability improvements issue.

lukewarlow avatar May 11 '25 10:05 lukewarlow

Yeah I think that making selection not follow focus as I implemented in the prototype is best.

If someone brings this up again, we can reopen this or file a new issue.

josepharhar avatar May 13 '25 18:05 josepharhar