forked from 2sys/phonograph
11 lines
242 B
JavaScript
11 lines
242 B
JavaScript
|
|
import { Error, Ok } from "./gleam.mjs";
|
||
|
|
|
||
|
|
export function focusElement(selector, root) {
|
||
|
|
const element = root.querySelector(selector);
|
||
|
|
if (element) {
|
||
|
|
element.focus();
|
||
|
|
return new Ok(undefined);
|
||
|
|
}
|
||
|
|
return new Error(undefined);
|
||
|
|
}
|