Skip to content

Commit

Permalink
Fix double click/tap so subsequent single clicks/taps aren't...
Browse files Browse the repository at this point in the history
...counted as double

#417
  • Loading branch information
AntumDeluge committed Feb 21, 2024
1 parent d958b81 commit 982deb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions srcjs/stendhal/ui/component/ItemContainerImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ export class ItemContainerImplementation {

isDoubleClick(evt: MouseEvent) {
if (this.timestampMouseDown - this.timestampMouseDownPrev <= this.rightClickDuration) {
// reset so subsequent single clicks/taps aren't counted
this.timestampMouseDown = 0;
return (stendhal.ui.html.extractTarget(event) as HTMLElement).id === this.lastClickedId;
}
this.lastClickedId = (stendhal.ui.html.extractTarget(event) as HTMLElement).id;
Expand Down

0 comments on commit 982deb7

Please sign in to comment.