A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
fix(input, searchbar, textarea): ensure nativeInput is always available (#28362)
Issue number: resolves #28283
---------
<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->
<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
`getInputElement()` is used to access the native input. If the component
has yet to render, then the function will return `undefined`. This
happens mostly when using `ref` on React.
```tsx
<IonInput ref={async input => {
const nativeInput = await input.getInputElement();
// nativeInput is undefined
}} />
```
## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
- `getInputElement()` will wait to return once the component is ready.
## Does this introduce a breaking change?
- [ ] Yes
- [x] No
<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->
## Other information
<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
Dev build: `7.5.1-dev.11697488622.175c9183` M
Maria Hutt committed
2b015b22144e306444f2bf30ace0b5cc7e32a710
Parent: 15a0225
Committed by GitHub <noreply@github.com>
on 10/23/2023, 5:09:41 PM