Skip to content

Commit

Permalink
added handleButtonClick function in button.js to fix the Guide button
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Larsson authored and Jonas Larsson committed Feb 22, 2024
1 parent 2a9dc2d commit 8d4fb49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8d4fb49

Please sign in to comment.