adobe / adobe/spectrum-web-components
[Bug]: ActionMenu: menu-item with href triggers link twice
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 262
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 68
Description
### Code of conduct
- [x] I agree to follow this project's code of conduct.
### Impacted component(s)
MenuItem, ActionMenu
### Expected behavior
When we add a href attribute to menu-item this link should only open once.
### Actual behavior
Adding an href attribute to an menu-item (and setting target="_blank") it opens two tabs instead of one.
### Screenshots
_No response_
### What browsers are you seeing the problem in?
Chrome
### How can we reproduce this issue?
1. Go to https://stackblitz.com/edit/vitejs-vite-rsqt9vbz?file=src%2Fmy-element.ts
2. Make sure Popup blocked is deactivated (or Popups are allowed for all sites)
3. Click on "More Actions" menu
4. Click on "Open link in new tab"
5. See that 2 tabs are opened


### Sample code or abstract reproduction which illustrates the problem
_No response_
### Severity
SEV 4
### Logs taken while reproducing problem
_No response_
### Would you like to track this issue in Jira?
- [ ] Yes, please tell me the ticket number!
Contributor guide
Research direction
Start with the linked StackBlitz reproduction and inspect the MenuItem and ActionMenu href handling involved in the "Open link in new tab" action. Reproduce the issue in Chrome with popups allowed; done means clicking the menu item opens exactly one tab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100