Skip to content

Commit

Permalink
✨Considered env in UIProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
carefree0910 committed Nov 5, 2024
1 parent e10fb3b commit 664e3bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cfb-core/src/event/pointer/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ export class UIProcessor<D, T extends ISingleNodeR, W extends IWorld>
case "onPointerUp": {
if (this.state === UIState.PRESS) {
const pointed = this.pointer?.in(this.node.bbox) ?? false;
this.state = pointed ? UIState.ENTER : UIState.IDLE;
this.state = data.env === "touch"
? UIState.IDLE
: pointed
? UIState.ENTER
: UIState.IDLE;
if (pointed) {
this.onClick?.(this.getEventData(data.world));
}
Expand Down

0 comments on commit 664e3bc

Please sign in to comment.