Skip to content

Commit b875be8

Browse files
committed
Register a click when touch starts
Also, don't scroll the page when touching cards.
1 parent 101ed71 commit b875be8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/ResponsiveSetCard.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const useStyles = makeStyles((theme) => ({
2222
},
2323
clickable: {
2424
cursor: "pointer",
25+
touchAction: "none",
2526
"@media(hover: hover) and (pointer: fine)": {
2627
"&:hover": {
2728
boxShadow: "0px 0px 5px 3px #bbb",
@@ -126,6 +127,8 @@ function ResponsiveSetCard(props) {
126127
border: faceDown ? undefined : BORDERS[border],
127128
}}
128129
onMouseDown={onClick}
130+
onTouchStart={onClick}
131+
onTouchEnd={(event) => event.preventDefault()}
129132
>
130133
{faceDown ||
131134
Array.from(Array(number + 1), (_, i) => (

0 commit comments

Comments
 (0)