Element, EventTarget, or CSS selector.
Optional
options: FocusOptions<TN>Options for setting focus.
Optional
delay?: numberDelay (in milliseconds) to wait until attempting to set focus.
Optional
parent?: TargetParent element (if target
is a css!CssSelector
).
Optional
preventScroll?: booleanIf true, don't scroll the focused element into view.
See the MDN documentation for preventScroll
for additional details.
Sets focus to the specified
target
. Specify additionaloptions
to refine thefocus
operation.Note that we don't throw if the
target
isnull
because it may not exist yet if acss!CssSelector
is specified.