Skip to content

Commit

Permalink
Merge pull request #6 from svecosystem/small-changes
Browse files Browse the repository at this point in the history
small updates
  • Loading branch information
TGlide authored Apr 13, 2024
2 parents a627f93 + 00755c5 commit 53287d1
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 53287d1

Please sign in to comment.