forked from 2sys/phonograph
10 lines
242 B
JavaScript
10 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);
|
|
}
|