don't focus buttons on click

This prevents the navbar buttons from gaining focus when clicked.
This way it prevents losing focus from the editor or terminal.
It also prevents the settings button from being highlighted after
the settings menu is closed.
This commit is contained in:
David Lechner
2021-01-27 10:25:08 -06:00
parent c7803fed19
commit eebeec509c
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -51,6 +51,7 @@ class ActionButton extends React.Component<Props> {
<Button
ref={this.buttonRef}
intent={Intent.PRIMARY}
onMouseDown={(e) => e.preventDefault()} // prevent focus
onClick={(): void => this.props.onAction()}
disabled={this.props.enabled === false}
className="no-box-shadow"
+1
View File
@@ -114,6 +114,7 @@ class OpenFileButton extends React.Component<Props> {
? { pointerEvents: 'none' }
: undefined
}
onMouseDown={(e) => e.preventDefault()} // prevent focus
// onClick={this.props.onClick}
// breaks Dropzone when this.props.onClick is undefined
// so we have to do it the long way