react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Tree breaks when expandedKey is 'all'

Open jonasmayer opened this issue 1 year ago โ€ข 1 comments

Provide a general summary of the issue here

When you set expandedKeys value to 'all' it will display the error

'expandedKeys.has is not a function'

Thats causes by the line https://github.com/adobe/react-spectrum/blob/f5a80a09d52ce240df4edef27d42a8a7c1e0f2d7/packages/react-aria-components/src/Tree.tsx#L839

Where there is not a check for 'all' like the other parts of the code

๐Ÿค” Expected Behavior?

IT should expand all nodes

๐Ÿ˜ฏ Current Behavior

DIsplays an error message 'expandedKeys.has is not a function'

๐Ÿ’ Possible Solution

Possibly adding a check for 'all' as the rest of the code, but Im not familiar with the codebase

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

  1. Create a simple Tree component
  2. Set expandedKeys prop as 'all'

Version

1.11.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

linux

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

jonasmayer avatar Jul 23 '25 02:07 jonasmayer

Thanks for the issue. We do not support "all" on expanded keys at this time. See prop definitions here https://react-spectrum.adobe.com/react-aria/Tree.html#props

See https://github.com/adobe/react-spectrum/issues/6568#issuecomment-2785381206 for more information

snowystinger avatar Jul 23 '25 04:07 snowystinger