question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove the focus on buttons and other components when clicking.

See original GitHub issue

This is a problem considering that the user experience is diminished and the website in whole looks worse when this occurs.

RemoveThis

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.

Test

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rv178commented, Apr 6, 2021

I have already told but still, how will the user know about the interaction like how will we know if the button is clicked. There are ripples for material design what’s there here?

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;

0reactions
lorstenoplocommented, Apr 6, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found