focus-visible icon indicating copy to clipboard operation
focus-visible copied to clipboard

Is there a way to remove the .focus-visible class name when clicking.

Open kevzlou7979 opened this issue 4 years ago • 5 comments

Hi there,

First thing, thanks for this awesome polyfill. Just want to ask a quick question if there's a way you can remove the class name focus-visible on this library. See the image below.

issue1

kevzlou7979 avatar Aug 24 '20 06:08 kevzlou7979

Tabbing works great, but when clicking on the Warn for example I want to remove the .focus-visible class name.

kevzlou7979 avatar Aug 24 '20 06:08 kevzlou7979

hi @kevzlou7979 I'm not sure I'm understanding what's happening in the video, do you have some sample code you can share?

robdodson avatar Oct 09 '20 16:10 robdodson

@robdodson I see this function:

  function onPointerDown(e) {
    hadKeyboardEvent = false;
  }

That doesn't remove the .focus-visible class, so I guess if I have the focus on an input and I click on a paragraph the input will still have .focus-visible, which seems wrong?


Edit: Though I see later on there's an onFocus function which could potentially reset the focus, but it doesn't seem to reset it, like if I click on the body the input is not in focus anymore, but the body is ignored by this polyfill.

fabiospampinato avatar Sep 05 '22 22:09 fabiospampinato

Sorry I'm still not sure I understand the actual bug. Could y'all share a codesandbox or something with steps to reproduce the issue?

robdodson avatar Sep 12 '22 15:09 robdodson

Sorry I was just looking at the code, I probably just read it wrong. I'm not sure what the problem that @kevzlou7979 was reporting actually is.

fabiospampinato avatar Sep 12 '22 15:09 fabiospampinato