mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(inputs): fix aria with shadow-dom (#16329)
This commit is contained in:
@ -21,8 +21,16 @@ export function hasShadowDom(el: HTMLElement) {
|
||||
return !!el.shadowRoot && !!(el as any).attachShadow;
|
||||
}
|
||||
|
||||
export function renderHiddenInput(container: HTMLElement, name: string, value: string | undefined | null, disabled: boolean) {
|
||||
if (hasShadowDom(container)) {
|
||||
export function findItemLabel(componentEl: HTMLElement) {
|
||||
const itemEl = componentEl.closest('ion-item');
|
||||
if (itemEl) {
|
||||
return itemEl.querySelector('ion-label');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function renderHiddenInput(always: boolean, container: HTMLElement, name: string, value: string | undefined | null, disabled: boolean) {
|
||||
if (always || hasShadowDom(container)) {
|
||||
let input = container.querySelector('input.aux-input') as HTMLInputElement | null;
|
||||
if (!input) {
|
||||
input = container.ownerDocument!.createElement('input');
|
||||
|
||||
Reference in New Issue
Block a user