mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
refactor(all): strict boolean conditions
This commit is contained in:
@ -10,12 +10,12 @@ export function reorderArray(array: any[], indexes: {from: number, to: number}):
|
||||
}
|
||||
|
||||
export function hasShadowDom(el: HTMLElement) {
|
||||
return !!el.shadowRoot && !!el.attachShadow;
|
||||
return !!el.shadowRoot && !!(el as any).attachShadow;
|
||||
}
|
||||
|
||||
export function renderHiddenInput(container: HTMLElement, name: string, value: string, disabled: boolean) {
|
||||
if (hasShadowDom(container)) {
|
||||
let input = container.querySelector('input.aux-input') as HTMLInputElement;
|
||||
let input = container.querySelector('input.aux-input') as HTMLInputElement | null;
|
||||
if (!input) {
|
||||
input = container.ownerDocument.createElement('input');
|
||||
input.type = 'hidden';
|
||||
|
||||
Reference in New Issue
Block a user