mirror of
https://github.com/usememos/memos.git
synced 2024-12-20 01:31:29 +03:00
chore: update dialog overflow style (#1872)
This commit is contained in:
parent
db8b8f0d58
commit
c83fd1de38
@ -25,7 +25,6 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
|
|||||||
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
|
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.body.classList.add("overflow-hidden");
|
|
||||||
dialogStore.pushDialogStack(dialogName);
|
dialogStore.pushDialogStack(dialogName);
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (event.code === "Escape") {
|
if (event.code === "Escape") {
|
||||||
@ -40,9 +39,6 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
|
|||||||
return () => {
|
return () => {
|
||||||
document.body.removeEventListener("keydown", handleKeyDown);
|
document.body.removeEventListener("keydown", handleKeyDown);
|
||||||
dialogStore.removeDialog(dialogName);
|
dialogStore.removeDialog(dialogName);
|
||||||
if (dialogStore.state.dialogStack.length === 0) {
|
|
||||||
document.body.classList.remove("overflow-hidden");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -92,7 +88,6 @@ export function generateDialog<T extends DialogProps>(
|
|||||||
hide: () => {
|
hide: () => {
|
||||||
tempDiv.firstElementChild?.classList.remove("showup");
|
tempDiv.firstElementChild?.classList.remove("showup");
|
||||||
tempDiv.firstElementChild?.classList.add("showoff");
|
tempDiv.firstElementChild?.classList.add("showoff");
|
||||||
document.body.classList.remove("overflow-hidden");
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
@apply text-base w-full h-full dark:bg-zinc-800;
|
@apply text-base w-full h-full overflow-hidden dark:bg-zinc-800;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans",
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans",
|
||||||
"Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", "Apple Color Emoji", "Segoe UI Emoji",
|
"Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", "Apple Color Emoji", "Segoe UI Emoji",
|
||||||
"Segoe UI Symbol", "Noto Color Emoji", sans-serif;
|
"Segoe UI Symbol", "Noto Color Emoji", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
@apply w-full h-full;
|
@apply w-full h-full overflow-auto;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user