Skip to content

TagGroup loses focus to document.body after removing only visible Tag with other collapsed Tags remaining  #4224

@majornista

Description

@majornista

🐛 Bug Report

TagGroup: maxRows + onRemove Storybook example initializes with one visible Tag, reading "Cool Tag 1" and a button reading "Show All (6)." If a user moves keyboard focus to the Tag and presses delete to remove that Tag, the TagGroup redraws to show two of the previously hidden Tags, "Another cool tag" and "This tag", and the "Show All (5)" button.

🤔 Expected Behavior

After removing the first Tag, focus should restore to the first Tag in the TagGroup.

😯 Current Behavior

Focus is lost to the document.body.

💁 Possible Solution

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
react-spectrum @adobe/react-spectrum@3.25.1
Browser Google Chrome Version 111.0.5563.64 (Official Build) (arm64)
Operating System macOS Ventura 13.2.1 (22D68)

🧢 Your Company/Team

Adobe/Accessibility

🕷 Tracking Issue (optional)

A11Y-5870

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions