Skip to content

Commit

Permalink
Remove unwanted text selection
Browse files Browse the repository at this point in the history
  • Loading branch information
LightFLP committed Oct 10, 2023
1 parent 532397c commit f3adda6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/viewer/log/LogView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,13 @@ export default class LogView extends React.Component<Props, State> {
}

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 ?
Expand Down
7 changes: 7 additions & 0 deletions src/viewer/structures/StructureDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ export default class StructureDialog extends React.Component<Props, State> {
},
});

const selection = getSelection();

if(selection !== null){
// empty unwanted text selection resulting from Shift-click
selection.empty();
}

return (
<div style={structureDialogBackdropStyle}>
<div className="dialog" style={structureDialogDialogStyle}>
Expand Down

0 comments on commit f3adda6

Please sign in to comment.