Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(engine-render): prevent full-sheet highlighting on right-click in Safari (#8091)

白熱1e05fa2eaace
diff --git a/packages/engine-render/src/canvas.ts b/packages/engine-render/src/canvas.ts
index 19554255d8..bea7689d7e 100644
--- a/packages/engine-render/src/canvas.ts
+++ b/packages/engine-render/src/canvas.ts
@@ -84,6 +84,9 @@ export class Canvas {
this._canvasEle.tabIndex = 1;
this._canvasEle.style.touchAction = 'none';
this._canvasEle.style.outline = '0';
+ // Safari can select the entire canvas when opening a context menu.
+ this._canvasEle.style.userSelect = 'none';
+ this._canvasEle.style.webkitUserSelect = 'none';
const context = this._canvasEle.getContext('2d');
if (context == null) {