diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 59cc60d69b..3b219717f3 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -1270,7 +1270,7 @@ export namespace Components { */ "required": boolean; /** - * 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. + * 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. Developers who wish to focus an input when an overlay is presented should call `setFocus` after `didPresent` has resolved. */ "setFocus": () => Promise; /** @@ -2583,7 +2583,7 @@ export namespace Components { */ "searchIcon"?: string; /** - * Sets focus on the specified `ion-searchbar`. Use this method instead of the global `input.focus()`. + * Sets focus on the native `input` in `ion-searchbar`. 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. Developers who wish to focus an input when an overlay is presented should call `setFocus` after `didPresent` has resolved. */ "setFocus": () => Promise; /** diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx index 1f99f234c3..c6a97a381d 100644 --- a/core/src/components/input/input.tsx +++ b/core/src/components/input/input.tsx @@ -397,6 +397,9 @@ export class Input implements ComponentInterface { * * Developers who wish to focus an input when a page enters * should call `setFocus()` in the `ionViewDidEnter()` lifecycle method. + * + * Developers who wish to focus an input when an overlay is presented + * should call `setFocus` after `didPresent` has resolved. */ @Method() async setFocus() { diff --git a/core/src/components/searchbar/searchbar.tsx b/core/src/components/searchbar/searchbar.tsx index f4bbcf6b03..85b717169a 100644 --- a/core/src/components/searchbar/searchbar.tsx +++ b/core/src/components/searchbar/searchbar.tsx @@ -243,8 +243,14 @@ export class Searchbar implements ComponentInterface { } /** - * Sets focus on the specified `ion-searchbar`. Use this method instead of the global + * Sets focus on the native `input` in `ion-searchbar`. 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. + * + * Developers who wish to focus an input when an overlay is presented + * should call `setFocus` after `didPresent` has resolved. */ @Method() async setFocus() {