Skip to content

Commit

Permalink
Merge pull request #61 from TNO/bug-fix/unwanted-text-selection
Browse files Browse the repository at this point in the history
Remove unwanted text selection when Structure Matching
  • Loading branch information
LightFLP authored Oct 10, 2023
2 parents 3a48aa5 + d11b8f8 commit 3945ebf
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 3945ebf

Please sign in to comment.