Skip to content

[focusgroup] tablist behavior token is misleading #1417

@g12n

Description

@g12n

If the intention is to limit the behavior of focusgroup strictly to focus navigation, without any concept of activation or triggering commands on the child elements, I would strongly suggest removing the "tablist" behavior token.

Especially for beginners, this naming is confusing and frustrating.

Initially, attempting to use the ARIA tablist role had no effect.

Then focusgroup="tablist" appeared promising, but it only implements a small part of the expected behavior.

In practice, it is technically just shorthand for focusgroup="inline wrap"

All remaining aspects of a tablist interaction still need to be implemented manually.
Because of this, the "tablist" behavior token implies functionality that is not actually providedd.

The name "tablist" strongly implies behavior aligned with the ARIA tablist pattern

Authors encountering focusgroup="tablist" may reasonably expect that it assists with:

  • activating tabs
  • managing the selected state
  • coordinatin tab panels

Since none of this functionality is provided, the token name may lead developers toward incorrect assumptions.

Proposal: Remove the tablist behavior token

If the intention of focusgroup is to remain strictly limited to focus navigation, I suggest to remove the tablist and actually most of the other behavior tokens.

Ideally limit the set of tokens to directional cues, wraps and memory.

This would avoid implying support for a higher-level UI pattern that the feature does not actually implement.

Alternative Integrate focusgroup with invoker commands

Integrate focusgroup with invoker commands

If focusgroup were able to trigger invoker commands when focus changes, it could enable a declarative tab pattern.

<div focusgroup="inline invoke">
    <button focusgroupstart commandfor="tabpanel1" command="toggle">Tab 1</button>
    <button commandfor="tabpanel2" command="toggle-openable">Tab 2</button>
    <button commandfor="tabpanel3" command="toggle-openable">Tab 3</button>
</div>

<div id="tabpanel1" openable defaultopen name="tabs"></div>
<div id="tabpanel2" openable name="tabs"></div>
<div id="tabpanel3" openable name="tabs"></div>

In such a model:

This would allow tabs to be expressed declaratively without JavaScript.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions