mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
reintroduce copy/paste on Apple devices and on touch screens
This commit is contained in:
parent
4d26993c8f
commit
56d1653d97
1 changed files with 11 additions and 6 deletions
|
@ -169,6 +169,7 @@ import {
|
|||
isArrowKey,
|
||||
KEYS,
|
||||
isAndroid,
|
||||
isDarwin,
|
||||
} from "../keys";
|
||||
import { distance2d, getGridPoint, isPathALoop } from "../math";
|
||||
import { renderScene } from "../renderer/renderScene";
|
||||
|
@ -5978,7 +5979,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
} else {
|
||||
ContextMenu.push({
|
||||
options: [
|
||||
this.device.isMobile &&
|
||||
(this.device.isTouchScreen || isDarwin) &&
|
||||
navigator.clipboard && {
|
||||
trackEvent: false,
|
||||
name: "paste",
|
||||
|
@ -5990,7 +5991,9 @@ class App extends React.Component<AppProps, AppState> {
|
|||
},
|
||||
contextItemLabel: "labels.paste",
|
||||
},
|
||||
this.device.isMobile && navigator.clipboard && separator,
|
||||
(this.device.isTouchScreen || isDarwin) &&
|
||||
navigator.clipboard &&
|
||||
separator,
|
||||
probablySupportsClipboardBlob &&
|
||||
elements.length > 0 &&
|
||||
actionCopyAsPng,
|
||||
|
@ -6035,9 +6038,11 @@ class App extends React.Component<AppProps, AppState> {
|
|||
} else {
|
||||
ContextMenu.push({
|
||||
options: [
|
||||
this.device.isMobile && actionCut,
|
||||
this.device.isMobile && navigator.clipboard && actionCopy,
|
||||
this.device.isMobile &&
|
||||
(this.device.isTouchScreen || isDarwin) && actionCut,
|
||||
(this.device.isTouchScreen || isDarwin) &&
|
||||
navigator.clipboard &&
|
||||
actionCopy,
|
||||
(this.device.isTouchScreen || isDarwin) &&
|
||||
navigator.clipboard && {
|
||||
name: "paste",
|
||||
trackEvent: false,
|
||||
|
@ -6049,7 +6054,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
},
|
||||
contextItemLabel: "labels.paste",
|
||||
},
|
||||
this.device.isMobile && separator,
|
||||
(this.device.isTouchScreen || isDarwin) && separator,
|
||||
...options,
|
||||
separator,
|
||||
actionCopyStyles,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue