Buttons trigger on mouse up not mouse down

This commit is contained in:
Jordan Eldredge 2021-06-30 19:25:31 -07:00
parent 9d36382fac
commit 2540b4b7c0

View file

@ -92,7 +92,7 @@ export default class Button extends GuiObj {
_bindToDom() {
// TODO: Cleanup!
this._div.addEventListener("mousedown", this._handleMouseDown.bind(this));
this._div.addEventListener("mousedown", (e) => {
this._div.addEventListener("click", (e) => {
if (this._action) {
UI_ROOT.dispatch(this._action);
}