}
},
this.choices.map(m => {
- //a "choice" is a move
+ // A "choice" is a move
+ const applyMove = (e) => {
+ e.stopPropagation();
+ this.play(m);
+ this.choices = [];
+ };
+ const onClick =
+ this.mobileBrowser
+ ? { touchend: applyMove }
+ : { mouseup: applyMove };
return h(
"div",
{
".svg"
},
class: { "choice-piece": true },
- on: {
- click: () => {
- this.play(m);
- this.choices = [];
- }
- }
+ on: onClick
})
]
);