Skip to content

bug(FocusMonitor): Focus origin does not update correctly #27069

Open
@MariaBulboaca

Description

@MariaBulboaca

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

The focus origin does not change for the first element on the page when we leave the content of the page and then return with another focus origin for the element.

Reproduction

Steps to reproduce:

  1. Go to: https://stackblitz.com/edit/sl2c5w?file=src/app/focus-monitor-focus-via-example.html
  2. Click on the first button ("Focus Monitored Element")
  3. Focus origin is set to "mouse"
  4. Click on the URL from the page
  5. Press TAB key to focus again the first button

Expected Behavior

Focus origin should be "keyboard"
image

Actual Behavior

Focus origin remains set to "mouse"
focus-origin-cdk

Environment

  • Angular: 16.0.0
  • CDK/Material: 16.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/a11y

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions