How can I prevent inactive Bootstrap buttons from showing as active when they are in focus on iOS? #41932
Unanswered
seanthegeek
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using buttons and transparent pills in Bootstrap for filters on a page. This works great everywhere except iOS, where if a user taps on a button to make it inactive, the button will be inactive but will still appear to be active until the user taps somewhere else. For clarity, I'm talking about the button or pill background being filled, not the focus outline, which is not bothersome. AI has suggested that I use JavaScript
blur()to force rpainting of the button, but that has its own issue of needing to keep track of each button state in JavaScript rather than CSS so that buttons that are toggled as active don't get repainted as inactive. I've tried checking for theactiveclass on click, and only callingblurif the button no longer has theactiveclass, but that check didn't work, likely because of a race condition between removing theactiveclass, and checking for the class.I have also tried this CSS without success.
Is there a better solution?
Beta Was this translation helpful? Give feedback.
All reactions