Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TGlide committed Apr 13, 2024
1 parent a627f93 commit 00755c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { documentDefined } from "../../internal/utils/defined.js";
import { isBrowser } from "$lib/internal/utils/browser.js";

export function useActiveElement(): { value: Readonly<Element | null> } {
const activeElement = $state({ value: documentDefined() ? document.activeElement : null });
const activeElement = $state({ value: isBrowser() ? document.activeElement : null });

function onFocusChange() {
activeElement.value = document.activeElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function documentDefined() {
export function isBrowser() {
return typeof document !== "undefined";
}

0 comments on commit 00755c5

Please sign in to comment.