Skip to content

Commit

Permalink
fix: fix pointer-events when closing edit dialog (#987)
Browse files Browse the repository at this point in the history
* fix: fix pointer-events when closing edit dialog

* lint
  • Loading branch information
nightknighto authored Mar 9, 2023
1 parent f329522 commit df6eb2b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ const ContributorHighlightCard = ({ title, desc, prLink, user, id }: Contributor
const [open, setOpen] = useState(false);
const [host, setHost] = useState("");

useEffect( () => {
if(!open) {
setTimeout(() => {
document.body.setAttribute("style", "pointer-events:auto !important");
}, 1);
}
}, [open]);

const handleCopyToClipboard = async (content: string) => {
const url = new URL(content).toString();
try {
Expand Down Expand Up @@ -93,9 +101,6 @@ const ContributorHighlightCard = ({ title, desc, prLink, user, id }: Contributor
ToastTrigger({ message: "Highlights Updated Successfully", type: "success" });
mutate(`users/${user}/highlights`);
setOpen(false);
setTimeout(() => {
document.body.setAttribute("style", "pointer-events:auto !important");
}, 1);
} else {
setLoading(false);
setError("An error occurred while updating!!!");
Expand Down

0 comments on commit df6eb2b

Please sign in to comment.