Skip to content

Commit 2edbdaf

Browse files
committed
fix(app): revert removing of setFocus comment
1 parent 07b6a26 commit 2edbdaf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/src/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export namespace Components {
333333
*/
334334
"mode"?: "ios" | "md";
335335
/**
336-
* Sets focus on elements that use `ion-focusable`.
336+
* Used to set focus on an element that uses `ion-focusable`. Do not use this if focusing the element as a result of a keyboard event as the focus utility should handle this for us. This method should be used when we want to programmatically focus an element as a result of another user action. (Ex: We focus the first element inside of a popover when the user presents it, but the popover is not always presented as a result of keyboard action.)
337337
* @param elements - The elements to set focus on.
338338
*/
339339
"setFocus": (elements: HTMLElement[]) => Promise<void>;

core/src/components/app/app.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ export class App implements ComponentInterface {
1717
@Element() el!: HTMLElement;
1818

1919
/**
20-
* Sets focus on elements that use `ion-focusable`.
20+
* Used to set focus on an element that uses `ion-focusable`.
21+
* Do not use this if focusing the element as a result of a keyboard
22+
* event as the focus utility should handle this for us. This method
23+
* should be used when we want to programmatically focus an element as
24+
* a result of another user action. (Ex: We focus the first element
25+
* inside of a popover when the user presents it, but the popover is not always
26+
* presented as a result of keyboard action.)
2127
*
2228
* @param elements - The elements to set focus on.
2329
*/

0 commit comments

Comments
 (0)