Skip to content

bug(mat-select): on openedChange, the panel value is wrong #31529

@jordandoan

Description

@jordandoan

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

18.1.2

Description

When triggering the event "openedChange," the panel value is defined when the panel is closed (openedChange emits false) and the panel value is undefined when the panel is open (openedChange emits true).

A current workaround is setting your logic based around the panel in a setTimeout function. My use case for this is setting an event listener on the scroll for the panel.

Reproduction

StackBlitz link:
https://stackblitz.com/edit/brlpethk?file=src%2Fexample%2Fselect-custom-trigger-example.html
Steps to reproduce:

  1. Open panel
  2. See that the panel value is undefined
  3. Close panel
  4. See that the panel value is defined

Expected Behavior

When the panel opens, the panel value should be defined

Actual Behavior

The panel value is undefined

Environment

  • Angular: 19.2.14
  • CDK/Material: 19.2.18
  • Browser(s): Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Mac 14.7.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/select

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions