Skip to content

Commit

Permalink
refactor(focus-visible): add console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Nov 26, 2024
1 parent aaebad5 commit ad7a02d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/utils/focus-visible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@ export const startFocusVisible = (rootEl?: HTMLElement): FocusVisibleUtility =>
elements.forEach((el) => el.classList.add(ION_FOCUSED));
currentFocus = elements;
};
const pointerDown = () => {
// SPACE triggers on iOS device with physical keyboard
const pointerDown = (ev: Event) => {
console.log('pointerDown', ev);
keyboardMode = false;
setFocus([]);
};

// Enter triggers on iOS device with physical keyboard
const onKeydown = (ev: Event) => {
console.log('onKeydown', ev);
keyboardMode = FOCUS_KEYS.includes((ev as KeyboardEvent).key);
if (!keyboardMode) {
setFocus([]);
}
};
const onFocusin = (ev: Event) => {
console.log('onFocusin', ev);
if (keyboardMode && ev.composedPath !== undefined) {
const toFocus = ev.composedPath().filter((el: any) => {
// TODO(FW-2832): type
Expand Down

0 comments on commit ad7a02d

Please sign in to comment.