mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
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:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user