Skip to content

ListBox onAction breaks selection #6506

Open
@ArrayKnight

Description

@ArrayKnight

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 the ListBox component, the standard selection behavior ceases to function

Maybe 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions