Skip to content

Commit dbd990a

Browse files
committed
feat: add .focus() function on component
1 parent 439aa2a commit dbd990a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ export class Component<T extends HTMLElement = HTMLElement> extends ElementCompo
8989
return new Component<T>(element);
9090
}
9191

92+
/**
93+
* Puts the element into
94+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus Focus}
95+
* @param options
96+
*/
97+
public focus(options?: FocusOptions): this {
98+
this.node.focus(options);
99+
return this;
100+
}
101+
92102
/**
93103
* Set style property
94104
* @param name Property name

0 commit comments

Comments
 (0)