Remove outline only on click event


As the title says I would like to remove the focusable HTML tags’ outline only when focus is triggered by a click event. This means I would like to keep outline for tabbing.

Does anyone know a practice or library I could use here?

If not, my idea is attaching an event listener to window that listens to click events and is nullifying target style outline on focus in the global styled component.

Is that a viable solution?
(Using React Next.js)

Source: React – Stack Overflow

November 24, 2021
Category : News
Tags: next.js | reactjs | styled-components

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.