adobe / adobe/spectrum-web-components
[Bug]: sp-button with href fires 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)
sp-button
### Expected behavior
When there is a valid href link, expect the sp-button click to only fire once.
### Actual behavior
The button fires twice - we noticed this in our analytics. Please see example: https://stackblitz.com/edit/vitejs-vite-ovhbrt2h?file=src%2Fmy-element.ts
### Screenshots
_No response_
### What browsers are you seeing the problem in?
Chrome
### How can we reproduce this issue?
1. Go to '...'
2. Click on '....'
3. Scroll to '....'
4. Check console
5. See error
### Sample code or abstract reproduction which illustrates the problem
_No response_
### Severity
None
### Logs taken while reproducing problem
_No response_
### Would you like to track this issue in Jira?
- [x] Yes, please tell me the ticket number!
Contributor guide
Research direction
Start with the sp-button component and the linked StackBlitz example, then reproduce the duplicate click in Chrome while inspecting the console or analytics event count. The issue names no repository file or test; done means a valid href produces exactly one click event, with the relevant regression coverage confirmed.
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
- Needs clarification
- Newbie friendliness
- 25/100