Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur event do not triggered in FF for disabled control #231

Open
svoronuk opened this issue Jun 12, 2020 · 5 comments
Open

Blur event do not triggered in FF for disabled control #231

svoronuk opened this issue Jun 12, 2020 · 5 comments

Comments

@svoronuk
Copy link

Switch from disabled control, e.g. button to enabled control, do not remove focusing style from disabled control.

Steps:

  1. Switch by using TAB to button element
  2. Disable button
  3. Switch by using TAB to enabled element, e.g. input

Result: Two elements marked like focused

DEMO: https://codesandbox.io/s/angry-lovelace-z8i6h?file=/src/index.js

@svoronuk
Copy link
Author

I suggest this patch for the fixing the issue
firefox_blur_patch.zip

@robdodson
Copy link
Collaborator

Hi @svoronuk, I'm not sure if I'm correctly seeing the problem. Are you saying that if a button has focus, and it is disabled, and then you tab away it will still have focus-visible applied? It doesn't seem like the polyfill is running in your demo (I don't see the .focus-visible class appearing). Could you add it?

Also, would you mind posting your suggested fix as a github gist instead of a zip? http://gist.github.com/

@svanherk
Copy link

svanherk commented Oct 6, 2021

I'm still seeing this problem today. I created a simple setup that demonstrates it: https://jsbin.com/gijuyatohe/1/edit?html,css,js,output
If you open this in Chrome, tab to the button to apply the focus-visible styling (an orange background), and press enter, the button becomes disabled and the orange background is removed. If you do the same in Firefox, the orange background is not removed because the focus-visible class is not removed from the button upon becoming disabled.

@mcaskill
Copy link

This issue is still present in Firefox v120 with focus-visible v5.2.0.
The test case provided by @svanherk reproduces this issue.

@robdodson
Copy link
Collaborator

Hey @mcaskill, unfortunately we don't have any plans to update this polyfill (see the Support section of the README). Is it possible for you to migrate away from the polyfill? :focus-visible is supported in all browsers and has been in Firefox since v85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants