jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

firefox and chrome checking onfocusin support not working anymore on recent versions

Open sweafa opened this issue 3 years ago • 5 comments

firefox 106.0.2 (64-bit) chrome 107.0.5304.63 (64-Bit)

line 8615 in jquery 3.5.1 (8647 in jquery 3.6.1) support.focusin = "onfocusin" in window; // this line is getting filled by false, therefore a fix would be applied starting at line 8813 in jquery 3.5.1 (8843 in jquery 3.6.1)

commenting out block: "if ( !support.focusin ) {" fixes issue at those browsers

i stumbled over this bug when suddenly all my jquery-ui dialogs with modal: true would not work anymore and threw error: Uncaught TypeError: doc.addEventListener is not a function

sweafa avatar Oct 27 '22 13:10 sweafa

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

Also, please provide a test case.

mgol avatar Nov 02 '22 18:11 mgol

I tried with those both versions: 1.12.1 and 1.13.2. I infer that it probably has to do with jquery or firefox/chrome versions (did they drop support for window.onfocusin ?) and this bug report is created wrongly here. but anyway i could not recreate the issue in a test case. maybe it has something to do with ajax injected script. my project also is not hosted public, so i cant provide that either. i will once again try to setup a test case.

sweafa avatar Nov 03 '22 07:11 sweafa

best i could manage was this: https://codepen.io/sweafa/pen/RwJPKRx but seems more like https://github.com/jquery/jquery/issues/5104 and https://github.com/jquery/jquery/issues/5015

in my project the hidden div + dialog modal comes from ajax injected script

sweafa avatar Nov 03 '22 08:11 sweafa

Firefox & Chrome never supported window.onfocusin and they have always got the fallback. We've removed the fallback in https://github.com/jquery/jquery/pull/4362 which will land in jQuery 4.0.0.

I tried your test case but I don't see any errors, either in Firefox 106, or in Chrome 107.

mgol avatar Nov 03 '22 10:11 mgol

yeah sorry about that testcase, i am not able to reproduce it on codepen. ah, so its ok that those browsers always get the fallback. then my first assumption was utterly wrong.

sweafa avatar Nov 03 '22 12:11 sweafa