fix: macOS transition flickers close #47

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

View File

@@ -20,6 +20,7 @@ import { CmdType } from "../../services/types";
import { atomLoadingCache } from "../../services/states";
import { updateProfile, deleteProfile, viewProfile } from "../../services/cmds";
import parseTraffic from "../../utils/parse-traffic";
import getSystem from "../../utils/get-system";
import ProfileEdit from "./profile-edit";
import FileEditor from "./file-editor";
import Notice from "../base/base-notice";
@@ -40,6 +41,8 @@ const round = keyframes`
to { transform: rotate(360deg); }
`;
const OS = getSystem();
interface Props {
selected: boolean;
itemData: CmdType.ProfileItem;
@@ -267,6 +270,9 @@ const ProfileItem = (props: Props) => {
anchorPosition={position}
anchorReference="anchorPosition"
transitionDuration={225}
TransitionProps={
OS === "macos" ? { style: { transitionDuration: "225ms" } } : {}
}
onContextMenu={(e) => {
setAnchorEl(null);
e.preventDefault();