From f3adda66c8b7b66e3b17e8ed4a1d8f22a2f9cc7f Mon Sep 17 00:00:00 2001 From: LightFLP Date: Tue, 10 Oct 2023 14:26:56 +0200 Subject: [PATCH] Remove unwanted text selection --- 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..4a14aed 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 (