mirror of
https://github.com/usememos/memos.git
synced 2025-12-13 00:27:44 +08:00
fix: body overflow styles #3056
Co-authored-by: zty <zty.dev@outlook.com>
This commit is contained in:
parent
ed1954c58c
commit
999a05307e
1 changed files with 2 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ export function generateDialog<T extends DialogProps>(
|
||||||
const tempDiv = document.createElement("div");
|
const tempDiv = document.createElement("div");
|
||||||
const dialog = createRoot(tempDiv);
|
const dialog = createRoot(tempDiv);
|
||||||
document.body.append(tempDiv);
|
document.body.append(tempDiv);
|
||||||
|
document.body.style.overflow = "hidden";
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tempDiv.firstElementChild?.classList.add("showup");
|
tempDiv.firstElementChild?.classList.add("showup");
|
||||||
|
|
@ -82,6 +83,7 @@ export function generateDialog<T extends DialogProps>(
|
||||||
destroy: () => {
|
destroy: () => {
|
||||||
tempDiv.firstElementChild?.classList.remove("showup");
|
tempDiv.firstElementChild?.classList.remove("showup");
|
||||||
tempDiv.firstElementChild?.classList.add("showoff");
|
tempDiv.firstElementChild?.classList.add("showoff");
|
||||||
|
document.body.style.removeProperty("overflow");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dialog.unmount();
|
dialog.unmount();
|
||||||
tempDiv.remove();
|
tempDiv.remove();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue