Skip to content

Commit

Permalink
Merge pull request #2443 from zeitgeistpm/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jun 12, 2024
2 parents eed02b2 + 70ba274 commit 732bab8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 13 additions & 1 deletion components/ui/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dialog, Transition } from "@headlessui/react";
import { ReactNode, Fragment } from "react";
import { ReactNode, Fragment, useEffect } from "react";

const Modal = ({
open,
Expand All @@ -10,6 +10,18 @@ const Modal = ({
open: boolean;
onClose: () => void;
}) => {
useEffect(() => {
if (typeof window !== undefined) {
const htmlElement = document.documentElement;

if (open) {
htmlElement.classList.add("dialog-open");
} else {
htmlElement.classList.remove("dialog-open");
}
}
}, [open]);

return (
<Transition appear show={open} as={Fragment}>
<Dialog open={true} onClose={onClose} className="relative z-ztg-50">
Expand Down
7 changes: 7 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ html {
font-size: 100%;
-webkit-tap-highlight-color: transparent;
}

/* prevents styles injected by headless ui */
html.dialog-open {
overflow: visible !important;
padding-right: 0 !important;
}

/* hide number input arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
Expand Down

0 comments on commit 732bab8

Please sign in to comment.