fix: context menu positioning (#4025)
This commit is contained in:
parent
bea4a1e066
commit
75aeaa6c38
@ -4092,6 +4092,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
actionToggleStats,
|
actionToggleStats,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (this.state.viewModeEnabled) {
|
||||||
ContextMenu.push({
|
ContextMenu.push({
|
||||||
options: viewModeOptions,
|
options: viewModeOptions,
|
||||||
top,
|
top,
|
||||||
@ -4100,11 +4101,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
appState: this.state,
|
appState: this.state,
|
||||||
container: this.excalidrawContainerRef.current!,
|
container: this.excalidrawContainerRef.current!,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
if (this.state.viewModeEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextMenu.push({
|
ContextMenu.push({
|
||||||
options: [
|
options: [
|
||||||
this.isMobile &&
|
this.isMobile &&
|
||||||
@ -4144,9 +4141,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
appState: this.state,
|
appState: this.state,
|
||||||
container: this.excalidrawContainerRef.current!,
|
container: this.excalidrawContainerRef.current!,
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
} else if (type === "element") {
|
||||||
if (this.state.viewModeEnabled) {
|
if (this.state.viewModeEnabled) {
|
||||||
ContextMenu.push({
|
ContextMenu.push({
|
||||||
options: [navigator.clipboard && actionCopy, ...options],
|
options: [navigator.clipboard && actionCopy, ...options],
|
||||||
@ -4156,9 +4152,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
appState: this.state,
|
appState: this.state,
|
||||||
container: this.excalidrawContainerRef.current!,
|
container: this.excalidrawContainerRef.current!,
|
||||||
});
|
});
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
ContextMenu.push({
|
ContextMenu.push({
|
||||||
options: [
|
options: [
|
||||||
this.isMobile && actionCut,
|
this.isMobile && actionCut,
|
||||||
@ -4202,6 +4196,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
appState: this.state,
|
appState: this.state,
|
||||||
container: this.excalidrawContainerRef.current!,
|
container: this.excalidrawContainerRef.current!,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private handleWheel = withBatchedUpdates((event: WheelEvent) => {
|
private handleWheel = withBatchedUpdates((event: WheelEvent) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user