adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.16k stars 1.06k forks source link

ColumnResizer won't let go of focus with empty rows #6549

Open rostero1 opened 3 weeks ago

rostero1 commented 3 weeks ago

Provide a general summary of the issue here

Once the column resizer gains focus it will not let go of that focus and you can't tab or use your arrow keys to escape. This only happens when there are no rows passed to the table.

๐Ÿค” Expected Behavior?

It should let go of focus.

๐Ÿ˜ฏ Current Behavior

It steals focus.

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://stackblitz.com/edit/vitejs-vite-c1a5kl?file=tailwind.config.js,src%2Findex.css,src%2FApp.tsx&terminal=dev

Version

latest stable react-aria-components

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Mac

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

snowystinger commented 3 weeks ago

Thanks for the issue. I see it in our storybook too if I alter https://github.com/adobe/react-spectrum/blob/4a8b24028308831a06a2450e6975b8816406315f/packages/react-aria-components/stories/Table.stories.tsx#L103 to have an empty array.

Even if I don't arrow key to the resizer, if I try to tab through, it goes to the resizer, which it doesn't when there are items.

I couldn't work around it with an empty state.

I'm not sure why it's happening, will need some investigation