File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -342,22 +342,20 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
342342 }
343343 }
344344
345- private willSynthesizeClick = 0 ;
345+ // if the click and pointerup events are on the same target, we should not
346+ // handle the click event.
347+ private pointerUpTarget = null as EventTarget | null ;
346348
347349 private handleClick ( event : Event ) : void {
348- if ( this . willSynthesizeClick ) {
349- cancelAnimationFrame ( this . willSynthesizeClick ) ;
350- this . willSynthesizeClick = 0 ;
350+ if ( this . pointerUpTarget === event . target ) {
351+ this . pointerUpTarget = null ;
351352 return ;
352353 }
353354 this . handlePointerBasedSelection ( event ) ;
354355 }
355356
356357 private handlePointerup ( event : Event ) : void {
357- this . willSynthesizeClick = requestAnimationFrame ( ( ) => {
358- event . target ?. dispatchEvent ( new Event ( 'click' ) ) ;
359- this . willSynthesizeClick = 0 ;
360- } ) ;
358+ this . pointerUpTarget = event . target ;
361359 this . handlePointerBasedSelection ( event ) ;
362360 }
363361
You can’t perform that action at this time.
0 commit comments