- How can I make a button remain in its focus state after clicking elsewhere?
- How do I stop my button from losing focus?
- How to remove focus from button after click in angular?
How can I make a button remain in its focus state after clicking elsewhere?
Instead of working with the focus property, maybe you could use jquery to assign an "active" class to the button when is clicked. If user clicks anywhere, the button remains active. Hope it helps.
How do I stop my button from losing focus?
If you want to prevent losing input focus when a user clicks your button, subscribe to the "pointerdown" event of this button and use the preventDefault method. After that, manually trigger all other keyboard events to imitate the native behavior. I have created anexample showing how to do this.
How to remove focus from button after click in angular?
If you want to remove the focus around a button, you can use the CSS outline property. You need to set the “none” value of the outline property.