focusIn listener causes issues with outside elements
See original GitHub issueRe: #42
When certain Kendo UI elements are attached to the body outside the focus-trap (i.e. datepicker), it attempts to regain focus in the focusIn
listener; even when using allowOutsideClick
or clickOutsideDeactivates
.
Not sure what the fix needs to be, but from the little time I have spent with this library, I think checking for these options in the focusIn
handler is also needed.
Optionally, a new option could be introduced that either takes a string (selector) or a callback that can check if the clicked/focused element is allowed to take focus.
Issue Analytics
- State:
- Created a year ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Element: focusout event - Web APIs | MDN
The focusout event fires when an element has lost focus, after the blur event. The two events differ in that focusout bubbles, while...
Read more >Element focus listener not triggered after first ... - Stack Overflow
The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the...
Read more >Focusing: focus/blur - The Modern JavaScript Tutorial
The focus event is called on focusing, and blur – when the element loses the focus. Let's use them for validation of an...
Read more >Bug: Behavior of onFocus event in React 17 is counterintuitive ...
I believe this is happening because React is now listening using a non-capturing focusin listener on the React root rather than a capturing ......
Read more >Catching the blur event on an element and its children
Recently I implemented a fly out menu in React, and stumbled on the following problem - I had to catch a blur event...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone else who responded to this issue would still like to have a constructive discussion about a possible solution, I’m happy to. Y’all know where my thoughts are at so far.
Maybe my use case is not exatly the same as Mark’s, but in general when we are talking about elements added directly to BODY I see two main problems (you’ve described it also eralier):
The whole problem comes form HTML/CSS limitations to handle such things like modals, dropdowns, etc. These all hacks with adding elements to body are problematic for operating from the keyboard becuase this braeks natural HTML elements order. Maybe someone knows some applications/websites when these things are properly implemented (eg. some government sites, which often are WCAG compliant)?