Skip to content

react-aria-components: <SelectValue> breaks when not inside a <Button> #8738

@barvian

Description

@barvian

Provide a general summary of the issue here

https://codesandbox.io/p/devbox/j3w789

You'll see an error occurs that seems to be caused by the <SelectValue> being outside of the <Button> component. If I move the <SelectValue> inside the <Button> component the issue is resolved.

🤔 Expected Behavior?

I'd expect <SelectValue/> to work anywhere in a <Select>, not just a <Button>.

😯 Current Behavior

Image

💁 Possible Solution

Strangely, if I wrap the <SelectValue> in an <ErrorBoundary> from react-error-boundary, the issue resolves 🤔

🔦 Context

No response

🖥️ Steps to Reproduce

https://codesandbox.io/p/devbox/j3w789

  1. Open preview, the error should immediately occur

Version

react-aria-components 1.11.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions