Button remains in pressed state when opening a modal
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 1.6k
- Avg merge
- 3d 9m
- Merged PRs (30d)
- 59
Description
### Provide a general summary of the issue here
Press a button to open a modal. Inspect button's html and you can see the button has the attribute `data-pressed=true`. It also doesn't go away when you're focusing/clicking inside a modal.
### 🤔 Expected Behavior?
Button should not remain in pressed state.
### 😯 Current Behavior
Button remains in pressed state.
### 💁 Possible Solution
_No response_
### 🔦 Context
I have an outline button that animates to having a black background on pressed/hovered state. When the button is pressed to open a modal, the black background is still visible which is distracting.
### 🖥️ Steps to Reproduce
https://stackblitz.com/edit/vitejs-vite-ydyoxcq5?file=src%2FApp.tsx
### Version
1.9.0
### What browsers are you seeing the problem on?
Chrome
### If other, please specify.
_No response_
### What operating system are you using?
Stackblitz
### 🧢 Your Company/Team
_No response_
### 🕷 Tracking Issue
_No response_
Contributor guide
Research direction
Start with the StackBlitz reproduction in src/App.tsx and inspect the button and modal interaction in Chrome. Trace why data-pressed remains after the modal opens or receives focus, then verify that the button no longer appears pressed while interacting with the modal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100