You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When combining two features of TagGroup - disabledKeys and onRemove - it's possible to crash the browser tab when removing a Tag.
This only seems to happen when there are at least two disabled Tags in the collection.
I'm able to reproduce in at least two ways:
Remove all non-disabled Tags from a collection (ctrl-a + backspace), leaving only disabled Tags remaining.
Remove the last Tag from the end of a collection where the (at least) two previous Tags are disabled.
It works fine when:
There is only one disabled Tag.
There is only one disabled Tag between the removed Tag and the next focusable Tag.
🤔 Expected Behavior?
The page should not crash and the next or previous non-disabled Tag should receive focus. If there are no remaining focusable Tags, the TagGroup or TagList should receive focus.
😯 Current Behavior
The page crashes.
💁 Possible Solution
At a guess, I would say that perhaps the TagGroup is struggling to find a valid target to move focus to when the element is removed.
Provide a general summary of the issue here
When combining two features of TagGroup -
disabledKeys
andonRemove
- it's possible to crash the browser tab when removing a Tag.This only seems to happen when there are at least two disabled Tags in the collection.
I'm able to reproduce in at least two ways:
It works fine when:
🤔 Expected Behavior?
The page should not crash and the next or previous non-disabled Tag should receive focus. If there are no remaining focusable Tags, the TagGroup or TagList should receive focus.
😯 Current Behavior
The page crashes.
💁 Possible Solution
At a guess, I would say that perhaps the TagGroup is struggling to find a valid target to move focus to when the element is removed.
🔦 Context
No response
🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/exciting-hooks-6lhjcm
Delete the final tag 'Watermelon' to crash the tab.
Version
react-aria-components 1.2.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: