From d11b8f82f3763067c93cab5305deeb59f58178a2 Mon Sep 17 00:00:00 2001 From: LightFLP Date: Tue, 10 Oct 2023 14:46:45 +0200 Subject: [PATCH] Remove unwanted text selection when Structure Matching --- src/viewer/log/LogView.tsx | 7 +++++++ src/viewer/structures/StructureDialog.tsx | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/viewer/log/LogView.tsx b/src/viewer/log/LogView.tsx index 0a4a7c0..6c41e20 100644 --- a/src/viewer/log/LogView.tsx +++ b/src/viewer/log/LogView.tsx @@ -448,6 +448,13 @@ export default class LogView extends React.Component { } render() { + const selection = getSelection(); + + if(selection !== null){ + // empty unwanted text selection resulting from Shift-click + selection.empty(); + } + const { logFile } = this.props; const containerHeight = this.getVisibleRows() * LOG_ROW_HEIGHT; const containerWidth = Object.keys(this.props.collapsibleRows).length > 0 ? diff --git a/src/viewer/structures/StructureDialog.tsx b/src/viewer/structures/StructureDialog.tsx index 1ee2517..e6b9295 100644 --- a/src/viewer/structures/StructureDialog.tsx +++ b/src/viewer/structures/StructureDialog.tsx @@ -479,6 +479,13 @@ export default class StructureDialog extends React.Component { }, }); + const selection = getSelection(); + + if(selection !== null){ + // empty unwanted text selection resulting from Shift-click + selection.empty(); + } + return (