diff --git a/.changeset/funny-turtles-cover.md b/.changeset/funny-turtles-cover.md new file mode 100644 index 000000000..d27aa844e --- /dev/null +++ b/.changeset/funny-turtles-cover.md @@ -0,0 +1,5 @@ +--- +'@equinor/fusion-wc-person': patch +--- + +Add `focusTextInput` method to person-select. diff --git a/packages/person/src/components/select/element.ts b/packages/person/src/components/select/element.ts index 7df19af62..6fe80343a 100644 --- a/packages/person/src/components/select/element.ts +++ b/packages/person/src/components/select/element.ts @@ -166,6 +166,14 @@ export class PersonSelectElement element: new PersonSelectController(this), }; + focusTextInput() { + requestAnimationFrame(() => { + if (this.textInputElement) { + this.textInputElement.focus(); + } + }); + } + updated(props: Map) { if (props.has('selectedPerson')) { this.controllers.element.attrSelectedPerson(