adobe / adobe/spectrum-web-components
[Feat]: sp-tag option to delete without removing from DOM
- 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-tag
### Description of the requested feature
We've seen some issues with the behavior of sp-tag on delete, and our framework which re-uses DOM elements -- we can get into a state where the framework is supposed to render an sp-tag, but it doesn't because it's been removed. While it's easy to add a `preventDefault` to the delete event, it's also an easy gotcha for new developers. The simplest improvement here would be to add an example to the docs where the deletion is handled automatically.
I'm writing this up as a feature request though so there can at least be some discussion of the philosophy here. I know in our application we want the button to be available, but we'd prefer to manage the DOM state ourselves. Maybe a `self-managed` attribute should be added similar to `sp-tooltip`?
### Mockups or screenshots
_No response_
### Implementation notes or ideas
_No response_
Contributor guide
Research direction
Start with the sp-tag component and its documentation, focusing on the delete behavior and the framework DOM-reuse case described here. Review the existing delete event handling and decide whether the requested outcome is documentation, an option, or both; done means the chosen behavior is clearly specified and covered for users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100