mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-592 - Prevent custom title bar buttons from taking focus (#478)
This commit is contained in:
parent
29fb713b75
commit
e5fb89842b
@ -77,6 +77,11 @@ class TitleBar {
|
||||
attachEventListeners(this.closeButton, 'click', this.closeWindow.bind(this));
|
||||
attachEventListeners(this.maximizeButton, 'click', this.maximizeOrUnmaximize.bind(this));
|
||||
attachEventListeners(this.minimizeButton, 'click', this.minimize.bind(this));
|
||||
|
||||
attachEventListeners(this.hamburgerMenuButton, 'mousedown', TitleBar.handleMouseDown.bind(this));
|
||||
attachEventListeners(this.closeButton, 'mousedown', TitleBar.handleMouseDown.bind(this));
|
||||
attachEventListeners(this.maximizeButton, 'mousedown', TitleBar.handleMouseDown.bind(this));
|
||||
attachEventListeners(this.minimizeButton, 'mousedown', TitleBar.handleMouseDown.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,6 +217,14 @@ class TitleBar {
|
||||
isValidWindow() {
|
||||
return !!(this.window && !this.window.isDestroyed());
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent default to make sure buttons don't take focus
|
||||
* @param e
|
||||
*/
|
||||
static handleMouseDown(e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user