Skip to content

bug(cdkMenu): menu template context is not updated when cdkMenuTriggerData is changed #26256

Open
@ghostlytalamaur

Description

@ghostlytalamaur

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

No response

Description

When cdkMenuTriggerData is used to pass additional context to a menu template the template context is not update when the data is changed.

Reproduction

GitHub
StackBlitz
Steps to reproduce:

  1. Open the application.
  2. Click the button "Click Me!". Menu with initial counter value is shown.
  3. Click "Increment" button.
  4. Click "Click Me!" button second time

Expected Behavior

Counter value in the context menu should be in sync with the value on the "Click Me!" button.

Actual Behavior

Counter value in the context menu keep initial value and is not updated when context changes.

Environment

  • Angular: 15.0.0
  • CDK/Material: 15.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions