Remove the focus on buttons and other components when clicking.
See original GitHub issueThis is a problem considering that the user experience is diminished and the website in whole looks worse when this occurs.
Solution
The easiest way to solve this is to style the button component with outline: none;
.
button:focus {
outline: none;
}
I had tried this myself and it seems to work, I did not create a pull request because I thought this was a very small snippet of code.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to remove focus around buttons on click
OPTION 1: Use the :focus-visible pseudo-class. The :focus-visible pseudo-class can be used to remove outlines and focus rings on buttons and various elements...
Read more >How to remove focus around buttons on click?
To remove focus around the button outline:none property is used. ... Outline property: Outline is an element property which draws a line around ......
Read more >How to remove focus from button after click? - JavaScript
I completed Javascript Calculator project. It works and pass tests, but I want the user to be able to use the keyboard as...
Read more >How to lose focus on clicked button? · Issue #1300
Button stay focused after click: the outline style can be removed by css: .btn:focus { outline: none; } but the Button still get...
Read more >Remove focus from clicked button - General
My client has bootstrap 4 css that has been butchered quite a bit. When a button in my component is clicked (with wire:click)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The user would know about it when the button is clicked, but I just suggested a really easy to implement and small feature in order to remove the border around the button which can easily be done just by styling the button with the attribute
outline: none;
Yeah instead of removing the outline on focus it should altered to something else like changing the colour, changing the size, box shadows, ripples etc. They will help to retain ux ( following the ARIA guidelines ) and improve the ui like a hell lot.