fix: macOS transition flickers close #47

This commit is contained in:
GyDi
2022-03-29 01:39:54 +08:00
parent 1f2c703ddc
commit d26830d81e
2 changed files with 12 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import {
} from "@mui/material";
import { CmdType } from "../../services/types";
import { viewProfile } from "../../services/cmds";
import getSystem from "../../utils/get-system";
import enhance from "../../services/enhance";
import ProfileEdit from "./profile-edit";
import FileEditor from "./file-editor";
@@ -29,6 +30,8 @@ const Wrapper = styled(Box)(({ theme }) => ({
boxSizing: "border-box",
}));
const OS = getSystem();
interface Props {
selected: boolean;
itemData: CmdType.ProfileItem;
@@ -219,6 +222,9 @@ const ProfileMore = (props: Props) => {
anchorPosition={position}
anchorReference="anchorPosition"
transitionDuration={225}
TransitionProps={
OS === "macos" ? { style: { transitionDuration: "225ms" } } : {}
}
onContextMenu={(e) => {
setAnchorEl(null);
e.preventDefault();