File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
gui/src/components/commons Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -359,13 +359,10 @@ export function DrawerTooltip({
359359 }
360360 } ;
361361
362- const touchEnd = ( e : MouseEvent | TouchEvent ) => {
363- if ( Date . now ( ) - touchTimestamp . current > TOOLTIP_DELAY ) {
364- // open drawer
365- e . preventDefault ( ) ; // cancel the click event
362+ const touchEnd = ( ) => {
363+ if ( Date . now ( ) - touchTimestamp . current < TOOLTIP_DELAY ) {
366364 clearTimeout ( touchTimeout . current ) ;
367-
368- open ( ) ;
365+ close ( ) ;
369366 }
370367 } ;
371368
@@ -394,12 +391,14 @@ export function DrawerTooltip({
394391
395392 elem . addEventListener ( 'touchstart' , touchStart ) ;
396393 elem . addEventListener ( 'touchend' , touchEnd ) ;
394+ elem . addEventListener ( 'touchcancel' , touchEnd ) ;
397395
398396 return ( ) => {
399397 elem . removeEventListener ( 'scroll' , scroll ) ;
400398
401399 elem . removeEventListener ( 'touchstart' , touchStart ) ;
402400 elem . removeEventListener ( 'touchend' , touchEnd ) ;
401+ elem . removeEventListener ( 'touchcancel' , touchEnd ) ;
403402 clearTimeout ( touchTimeout . current ) ;
404403 } ;
405404 }
You can’t perform that action at this time.
0 commit comments