mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(popover): only focus trap ion-item children (#24990)
Resolves #24633
This commit is contained in:
@ -337,6 +337,14 @@ export const configureKeyboardInteraction = (popoverEl: HTMLIonPopoverElement) =
|
||||
const activeElement = document.activeElement as HTMLElement | null;
|
||||
let items: HTMLIonItemElement[] = [];
|
||||
|
||||
const targetTagName = (ev.target as HTMLElement)?.tagName;
|
||||
/**
|
||||
* Only handle custom keyboard interactions for the host popover element
|
||||
* and children ion-item elements.
|
||||
*/
|
||||
if (targetTagName !== 'ION-POPOVER' && targetTagName !== 'ION-ITEM') {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Complex selectors with :not() are :not supported
|
||||
* in older versions of Chromium so we need to do a
|
||||
@ -353,7 +361,7 @@ export const configureKeyboardInteraction = (popoverEl: HTMLIonPopoverElement) =
|
||||
) as NodeListOf<HTMLIonItemElement>
|
||||
);
|
||||
/* eslint-disable-next-line */
|
||||
} catch {}
|
||||
} catch { }
|
||||
|
||||
switch (ev.key) {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user