adobe / adobe/spectrum-web-components
[Bug]: sp-action-button logs two click events
- 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-action-button
### Library version
1.7.0
### Expected behavior
A click on an sp-action-button triggers exactly on event.
### Actual behavior
The sp-action-button logs two click events.
One event has "isTrusted = false, the second one has isTrusted true.
This is not so much an issue for regular links (may actually impact analytics), but it's causing duplicate downloads when there is a "download" attribute.
### Screenshots
_No response_
### What browsers are you seeing the problem in?
Chrome, Firefox
### How can we reproduce this issue?
see sample code below.
### Sample code or abstract reproduction which illustrates the problem
console.log(`click handler, event is trusted: ${e.isTrusted}`)}
href="https://partners.adobe.com/channelpartnerassets/assets/public/public_1/aem_assets_dynamic_media_capability_spotlight_ue.pdf"
download="Adobe Experience Manager Assets Dynamic Media Capability Spotlight.pdf">
### Severity
None
### Logs taken while reproducing problem
click handler, event is trusted: false
click handler, event is trusted: true
### Would you like to track this issue in Jira?
- [x] Yes, please tell me the ticket number!
Contributor guide
Research direction
Start by locating the sp-action-button implementation and reproduce the supplied download example in Chrome or Firefox. Trace why the click handler receives both an untrusted and a trusted event; done means one click event and no duplicate download.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100