From 4a8b3c0773863f1047478ba3880a016141b5c713 Mon Sep 17 00:00:00 2001 From: Evan Kleiner Date: Thu, 15 Dec 2022 14:20:06 -0800 Subject: [PATCH] docs(input): update setFocus description (#26487) Co-authored-by: Evan Kleiner --- core/src/components.d.ts | 2 +- core/src/components/input/input.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 107ef42924..396879d6e9 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -1145,7 +1145,7 @@ export namespace Components { */ "setBlur": () => Promise; /** - * Sets focus on the native `input` in `ion-input`. Use this method instead of the global `input.focus()`. + * Sets focus on the native `input` in `ion-input`. Use this method instead of the global `input.focus()`. Developers who wish to focus an input when a page enters should call `setFocus()` in the `ionViewDidEnter()` lifecycle method. */ "setFocus": () => Promise; /** diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx index 82a6ab50d3..f409595b16 100644 --- a/core/src/components/input/input.tsx +++ b/core/src/components/input/input.tsx @@ -305,6 +305,9 @@ export class Input implements ComponentInterface { /** * Sets focus on the native `input` in `ion-input`. Use this method instead of the global * `input.focus()`. + * + * Developers who wish to focus an input when a page enters + * should call `setFocus()` in the `ionViewDidEnter()` lifecycle method. */ @Method() async setFocus() {