From 8d4fb4978e8e8333ef59cf3b4dc230fc47a70723 Mon Sep 17 00:00:00 2001 From: Jonas Larsson Date: Thu, 22 Feb 2024 09:58:45 +0100 Subject: [PATCH] added handleButtonClick function in button.js to fix the Guide button --- src/ui/button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/button.js b/src/ui/button.js index 2579a26ee..3253f6fe0 100644 --- a/src/ui/button.js +++ b/src/ui/button.js @@ -119,10 +119,11 @@ export default function Button(options = {}) { onRender() { buttonEl = document.getElementById(this.getId()); buttonEl.removeEventListener('click', this.handleButtonClick); - buttonEl.addEventListener('click', (e) => { + this.handleButtonClick = (e) => { this.dispatch('click'); e.preventDefault(); - }); + }; + buttonEl.addEventListener('click', this.handleButtonClick); buttonEl.addEventListener('mouseenter', (e) => { this.dispatch('mouseenter'); e.preventDefault();