cboard-org / cboard

Augmentative and Alternative Communication (AAC) system with text-to-speech for the browser
https://www.cboard.io
GNU General Public License v3.0
661 stars 174 forks source link

Fix #1774 #1776

Open DTProductions opened 3 days ago

DTProductions commented 3 days ago

The bug described in issue #1774 only happens when the scanning mode's scanning method is set to automatic, whereas the problem was that the Tile's onClick event was being fired twice when the output bar was empty.

Upon lots of debugging, I could state that this wasn't being caused by the events bubbling up (in both times the event's target and currentTarget were the same).

The culprit may lie in how the Scanner's automatic strategy handles the click event or the alternating DOM.

This PR fixes the issue by ensuring that the onClick event runs once, and only once.