Skip to content

Commit

Permalink
fix(core): use better check for document in tablistener
Browse files Browse the repository at this point in the history
  • Loading branch information
piofinn committed Dec 20, 2019
1 parent da9e4db commit 8a027e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/utils/tabListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function handleKeydown(event: KeyboardEvent) {
}

export function initTabListener() {
if (document) {
if (typeof document !== "undefined") {
document.addEventListener("mousedown", handleMouseDown);
}
}
2 changes: 0 additions & 2 deletions packages/progress-bar-react/documentation/Example.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useState } from "react";
import { ProgressBar } from "../src";
import { initTabListener } from "@fremtind/jkl-core";
import "@fremtind/jkl-progress-bar/progress-bar.css";
import "@fremtind/jkl-core/core.min.css";

export const Example = () => {
initTabListener();
const [val, setVal] = useState(50);

return (
Expand Down

0 comments on commit 8a027e5

Please sign in to comment.