mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(tabs): apply design-doc (#16048)
This commit is contained in:
@@ -25,7 +25,7 @@ export function renderHiddenInput(container: HTMLElement, name: string, value: s
|
||||
if (hasShadowDom(container)) {
|
||||
let input = container.querySelector('input.aux-input') as HTMLInputElement | null;
|
||||
if (!input) {
|
||||
input = container.ownerDocument.createElement('input');
|
||||
input = container.ownerDocument!.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.classList.add('aux-input');
|
||||
container.appendChild(input);
|
||||
|
||||
@@ -21,7 +21,7 @@ export function relocateInput(
|
||||
// before it receives the actual focus event
|
||||
// We hide the focused input (with the visible caret) invisiable by making it scale(0),
|
||||
cloneInputComponent(componentEl, inputEl);
|
||||
const doc = componentEl.ownerDocument;
|
||||
const doc = componentEl.ownerDocument!;
|
||||
const tx = doc.dir === 'rtl' ? 9999 : -9999;
|
||||
inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0)`;
|
||||
// TODO
|
||||
@@ -33,7 +33,7 @@ export function relocateInput(
|
||||
}
|
||||
|
||||
export function isFocused(input: HTMLInputElement): boolean {
|
||||
return input === input.ownerDocument.activeElement;
|
||||
return input === input.ownerDocument!.activeElement;
|
||||
}
|
||||
|
||||
function removeClone(componentEl: HTMLElement, inputEl: HTMLElement) {
|
||||
@@ -55,7 +55,7 @@ function cloneInputComponent(componentEl: HTMLElement, inputEl: HTMLInputElement
|
||||
// find its parent wrapping component like <ion-input> or <ion-textarea>
|
||||
// then clone the entire component
|
||||
const parentElement = componentEl.parentElement;
|
||||
const doc = componentEl.ownerDocument;
|
||||
const doc = componentEl.ownerDocument!;
|
||||
if (componentEl && parentElement) {
|
||||
// DOM READ
|
||||
const srcTop = componentEl.offsetTop;
|
||||
|
||||
Reference in New Issue
Block a user