Skip to content

[Bug]: First sp-menu-item is still focused when opened with click #5610

@lehelen19

Description

@lehelen19

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

sp-overlay, sp-menu, sp-menu-item

Library version

1.7.0

Expected behavior

As mentioned in #5351, the first menu item should not be highlighted when the menu is opened on click.

Actual behavior

When opening a menu in a modal overlay, the first sp-menu-item is focused. This is likely due to the modal overlay's focus trapping behavior (focusing on the first focusable element). This issue was previously addressed by #5358.

Screenshots

No response

What browsers are you seeing the problem in?

No response

How can we reproduce this issue?

  1. Go to https://stackblitz.com/edit/vitejs-vite-dadcccdz?file=src%2Fmy-element.ts
  2. Click on the button to open the menu
  3. Observe the highlighted (focused) menu item

Sample code or abstract reproduction which illustrates the problem

No response

Severity

SEV 1

Logs taken while reproducing problem

No response

Would you like to track this issue in Jira?

  • Yes, please tell me the ticket number!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions