From 4bd9f25eead245012776f7e591967db6c4ef51f4 Mon Sep 17 00:00:00 2001 From: Krzysztof Magiera Date: Thu, 6 Jun 2024 15:10:54 +0200 Subject: [PATCH 1/2] Disable user-select on most of the app UI --- packages/vscode-extension/src/webview/App.css | 1 + packages/vscode-extension/src/webview/App.tsx | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-extension/src/webview/App.css b/packages/vscode-extension/src/webview/App.css index f5eded03d..7f3e7e231 100644 --- a/packages/vscode-extension/src/webview/App.css +++ b/packages/vscode-extension/src/webview/App.css @@ -6,6 +6,7 @@ body, margin: 0; padding: 0; background-color: var(--swm-preview-background); + user-select: none; } main { diff --git a/packages/vscode-extension/src/webview/App.tsx b/packages/vscode-extension/src/webview/App.tsx index 97df7a63a..9aaad989a 100644 --- a/packages/vscode-extension/src/webview/App.tsx +++ b/packages/vscode-extension/src/webview/App.tsx @@ -1,6 +1,5 @@ import "./App.css"; import PreviewView from "./views/PreviewView"; -import { useDiagnosticAlert } from "./hooks/useDiagnosticAlert"; function App() { return ( From 951fd45a0b1b05dd8b037d3b06f72991246c98e5 Mon Sep 17 00:00:00 2001 From: Krzysztof Magiera Date: Thu, 6 Jun 2024 15:15:02 +0200 Subject: [PATCH 2/2] Disable it for panel-view only --- packages/vscode-extension/src/webview/App.css | 1 - packages/vscode-extension/src/webview/views/PreviewView.css | 4 ++++ packages/vscode-extension/src/webview/views/PreviewView.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/vscode-extension/src/webview/App.css b/packages/vscode-extension/src/webview/App.css index 7f3e7e231..f5eded03d 100644 --- a/packages/vscode-extension/src/webview/App.css +++ b/packages/vscode-extension/src/webview/App.css @@ -6,7 +6,6 @@ body, margin: 0; padding: 0; background-color: var(--swm-preview-background); - user-select: none; } main { diff --git a/packages/vscode-extension/src/webview/views/PreviewView.css b/packages/vscode-extension/src/webview/views/PreviewView.css index 0ee17c137..735d769c8 100644 --- a/packages/vscode-extension/src/webview/views/PreviewView.css +++ b/packages/vscode-extension/src/webview/views/PreviewView.css @@ -9,6 +9,10 @@ gap: 4px; } +.panel-view { + user-select: none; +} + .button-group-top { margin-bottom: 8px; } diff --git a/packages/vscode-extension/src/webview/views/PreviewView.tsx b/packages/vscode-extension/src/webview/views/PreviewView.tsx index c6e1335ec..a8dfab61f 100644 --- a/packages/vscode-extension/src/webview/views/PreviewView.tsx +++ b/packages/vscode-extension/src/webview/views/PreviewView.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback, Dispatch, SetStateAction } from "react"; +import { useState, useEffect, useCallback } from "react"; import { vscode } from "../utilities/vscode"; import Preview from "../components/Preview"; import IconButton from "../components/shared/IconButton";