Open ArrayKnight opened 1 month ago
Looks like we left out the onAction documentation for ListBox https://react-spectrum.adobe.com/react-aria/GridList.html#row-actions
What you want though is https://react-spectrum.adobe.com/react-aria/ListBox.html#selection-behavior to set this to "Replace" Then the default interaction will be selection and a double click will trigger the action, as it mentions in the GridList docs I linked to.
Otherwise, you need to provide a control to trigger selection on individual rows.
Provide a general summary of the issue here
Not sure if this is intended and undocumented or a bug
If you add an event listener to the
onAction
prop on theListBox
component, the standard selection behavior ceases to functionMaybe the expectation is that if you're listening to
onAction
you're handling all selection state externally(?)I discovered this when implementing a story for the component and binding all event handler props to actions (logs)
๐ค Expected Behavior?
Either document this as expected behavior or allow for
onAction
to be listened to without breaking internal selection state management๐ฏ Current Behavior
Binding
onAction
causes presses to not update selection state๐ Possible Solution
No response
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
https://codesandbox.io/p/sandbox/amazing-solomon-ypvhz7
Version
1.2.1
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