Merge remote-tracking branch 'origin/main' into sp/sync-feature-7-6-with-main

This commit is contained in:
Sean Perkins
2023-11-02 13:14:57 -04:00
442 changed files with 2740 additions and 1434 deletions

View File

@ -3,7 +3,13 @@ import { Build, Component, Element, Event, Host, Method, Prop, State, Watch, for
import type { LegacyFormController, NotchController } from '@utils/forms';
import { createLegacyFormController, createNotchController } from '@utils/forms';
import type { Attributes } from '@utils/helpers';
import { inheritAriaAttributes, debounceEvent, findItemLabel, inheritAttributes } from '@utils/helpers';
import {
inheritAriaAttributes,
debounceEvent,
findItemLabel,
inheritAttributes,
componentOnReady,
} from '@utils/helpers';
import { printIonWarning } from '@utils/logging';
import { createSlotMutationController } from '@utils/slot-mutation-controller';
import type { SlotMutationController } from '@utils/slot-mutation-controller';
@ -430,7 +436,14 @@ export class Input implements ComponentInterface {
* Returns the native `<input>` element used under the hood.
*/
@Method()
getInputElement(): Promise<HTMLInputElement> {
async getInputElement(): Promise<HTMLInputElement> {
/**
* If this gets called in certain early lifecycle hooks (ex: Vue onMounted),
* nativeInput won't be defined yet with the custom elements build, so wait for it to load in.
*/
if (!this.nativeInput) {
await new Promise((resolve) => componentOnReady(this.el, resolve));
}
return Promise.resolve(this.nativeInput!);
}