Skip to content

Commit

Permalink
Clean up "held" item on mouse up event
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Dec 2, 2023
1 parent f598d47 commit 17fee1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions srcjs/stendhal/ui/ViewPort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ export class ViewPort {
e.target.removeEventListener("mousemove", mHandle.onDrag);
e.target.removeEventListener("touchend", mHandle.onMouseUp);
e.target.removeEventListener("touchmove", mHandle.onDrag);

// clean up item held via touch
stendhal.ui.touch.unsetHeldItem();
}

return mHandle._onMouseDown;
Expand Down
4 changes: 4 additions & 0 deletions srcjs/stendhal/ui/component/ItemContainerImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ export class ItemContainerImplementation {
}
}
}

// clean up item held via touch
stendhal.ui.touch.unsetHeldItem();

document.getElementById("gamewindow")!.focus();
}

Expand Down

0 comments on commit 17fee1a

Please sign in to comment.