Skip to content

Commit 34598c9

Browse files
driskullbenelan
authored andcommitted
fix(autocomplete): fix setFocus method in Safari (#12092)
**Related Issue:** #12078 ## Summary - fixes setFocus method in safari by waiting for component to be focusable before proceeding to focus internal component
1 parent 0cdd5f5 commit 34598c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/calcite-components/src/components/autocomplete/autocomplete.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import type { AutocompleteItemGroup } from "../autocomplete-item-group/autocompl
5353
import type { Label } from "../label/label";
5454
import { Validation } from "../functional/Validation";
5555
import { createObserver } from "../../utils/observers";
56+
import { componentFocusable } from "../../utils/component";
5657
import { styles } from "./autocomplete.scss";
5758
import T9nStrings from "./assets/t9n/messages.en.json";
5859
import { CSS, IDS, SLOTS } from "./resources";
@@ -385,6 +386,8 @@ export class Autocomplete
385386
*/
386387
@method()
387388
async setFocus(): Promise<void> {
389+
await componentFocusable(this);
390+
388391
return this.referenceEl.setFocus();
389392
}
390393

0 commit comments

Comments
 (0)