mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(focus-visible): more comments
This commit is contained in:
@@ -29,6 +29,7 @@ export const startFocusVisible = (rootEl?: HTMLElement): FocusVisibleUtility =>
|
||||
const root = rootEl ? rootEl : document.body;
|
||||
|
||||
const setFocus = (elements: Element[]) => {
|
||||
console.log('setFocus', elements, currentFocus);
|
||||
currentFocus.forEach((el) => el.classList.remove(ION_FOCUSED));
|
||||
elements.forEach((el) => el.classList.add(ION_FOCUSED));
|
||||
currentFocus = elements;
|
||||
@@ -62,6 +63,7 @@ export const startFocusVisible = (rootEl?: HTMLElement): FocusVisibleUtility =>
|
||||
keyboardMode = true;
|
||||
};
|
||||
const onFocusout = () => {
|
||||
console.log('onFocusout');
|
||||
if (ref.activeElement === root) {
|
||||
setFocus([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user