File tree Expand file tree Collapse file tree
apps/scouting/frontend/src/scouter/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,9 +108,6 @@ export const ScoreMap: FC<ScoreMapProps> = ({
108108 const imageRef = useRef < HTMLImageElement | null > ( null ) ;
109109 const [ mapPoint , setMapPoint ] = useState ( currentPoint ) ;
110110 const handleMapClick = ( event : TouchEvent < HTMLImageElement > ) => {
111- if ( ! isHolding ) {
112- return ;
113- }
114111 const containerElement = containerRef . current ;
115112 const imageElement = imageRef . current ;
116113 if ( ! ( containerElement && imageElement ) ) {
@@ -147,9 +144,14 @@ export const ScoreMap: FC<ScoreMapProps> = ({
147144 < img
148145 ref = { imageRef }
149146 src = { mapZone === "red" ? redField : blueField }
150- onTouchMove = { handleMapClick }
151- onTouchStart = { ( ) => {
147+ onTouchMove = { ( event ) => {
148+ if ( isHolding ) {
149+ handleMapClick ( event ) ;
150+ }
151+ } }
152+ onTouchStart = { ( event ) => {
152153 setHolding ( true ) ;
154+ handleMapClick ( event ) ;
153155 } }
154156 onTouchEnd = { ( ) => {
155157 setHolding ( false ) ;
You can’t perform that action at this time.
0 commit comments