spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: Focus state management for sp-menu

Open castastrophe opened this issue 3 years ago • 0 comments

Code of conduct

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

Impacted component(s)

sp-menu

Expected behavior

Focus state should move smoothly through items in the menu with only 1 item receiving focus at a time.

Actual behavior

Focus state management seems to be altered when a submenu is present and can lead to duplicate focused menu items.

Screenshots

https://user-images.githubusercontent.com/1840295/183101382-d8ecd183-9926-4e16-97d5-5d08a062a89c.mov

How can we reproduce this issue?

TODO

Sample code that illustrates the problem

<sp-menu>
  <sp-menu-item>Item 1</sp-menu-item>
  <section>
    <sp-textfield value="url"></sp-textfield>
    <sp-action-button>Text</sp-action-button>
  </section>
  <sp-divider size="s"></sp-divider>
  <sp-menu-item>Item 2</sp-menu-item>
  <sp-divider size="s"></sp-divider>
  <sp-menu-item>
    Item 3
    <sp-menu slot="submenu">
      <sp-menu-item> Options 3a </sp-menu-item>
      <sp-menu-item> Options 3b </sp-menu-item>
      <sp-menu-item> Options 3c </sp-menu-item>
    </sp-menu>
  </sp-menu-item>
  <sp-menu-item> Item 4 </sp-menu-item>
  <sp-menu-item> Item 5 </sp-menu-item>
</sp-menu>

Logs taken while reproducing problem

No response

castastrophe avatar Aug 08 '22 15:08 castastrophe