Skip to content

Refine OpenChangeReason values #1773

Closed
@atomiks

Description

@atomiks

We currently translate OpenChangeReason from Floating UI, but:

  1. We don't consider Base UI specific reasons, like menu item click.
  2. trigger-press vs. click is confusing in the Base UI API as one refers to useDismiss hook vs. the useClick hook internally, but open: false is possible with both reasons and it's not clear why they're differentiated.

We currently either expose one of the following strings, or just skip it with undefined, but should instead provide more useful reasons:

export type OpenChangeReason =
  | 'click'
  | 'hover'
  | 'focus'
  | 'focus-out'
  | 'escape-key'
  | 'outside-press'
  | 'trigger-press';

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: improvementThis is not a bug, nor a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions