Skip to content

onClick propagation with usePress  #2100

@alexichristakis

Description

@alexichristakis

📝 Feedback

We rely on onClick events propagating through our dom structure. Sometimes the source of the event will be from a component using react-aria's useButton hook, but it appears that usePress stops the propagation. This forces us to stub stopPropagation for all events passed into react-aria.

We'd like some context on why usePress implements this behavior.

🔦 Context

Event bubbling is necessary in Retool's editor to support selecting interactive components. We've been very happy leveraging react-aria to improve our accessibility, but are confused by the decision to prevent events from bubbling.

💻 Code Sample

https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/interactions/src/usePress.ts#L242

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