@@ -103,30 +103,30 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
103103
104104 /**
105105 * Minimum vertical movement (in pixels) required to trigger scrolling detection.
106- *
106+ *
107107 * This threshold is consistent with other components in the design system:
108108 * - Card component uses 10px for click vs. drag detection
109109 * - Menu component uses 10px for scroll vs. selection detection
110- *
110+ *
111111 * The 10px threshold is carefully chosen to:
112112 * - Allow for natural finger tremor and accidental touches
113113 * - Distinguish between intentional scroll gestures and taps
114114 * - Provide consistent behavior across the platform
115- *
115+ *
116116 * @see {@link packages/card/src/Card.ts } for similar threshold usage
117117 */
118118 private scrollThreshold = 10 ; // pixels
119119
120120 /**
121121 * Maximum time (in milliseconds) for a movement to be considered scrolling.
122- *
122+ *
123123 * This threshold is consistent with other timing values in the design system:
124124 * - Longpress duration: 300ms (ActionButton, LongpressController)
125125 * - Scroll detection: 300ms (Menu component)
126- *
126+ *
127127 * Quick movements within this timeframe are likely intentional scrolls,
128128 * while slower movements are more likely taps or selections.
129- *
129+ *
130130 * @see {@link packages/action-button/src/ActionButton.ts } for longpress duration
131131 * @see {@link packages/overlay/src/LongpressController.ts } for longpress duration
132132 */
@@ -576,7 +576,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
576576 * Resets the scrolling state after a short delay (100ms) to allow for
577577 * any final touch events to be processed. This delay prevents immediate
578578 * state changes that could interfere with the selection logic.
579- *
579+ *
580580 * The 100ms delay is consistent with the design system's approach to
581581 * touch event handling and ensures that any final touch events or
582582 * gesture recognition can complete before the scrolling state is reset.
@@ -720,7 +720,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
720720 ) : MenuItem {
721721 const diff = before ? - 1 : 1 ;
722722 const elements = this . rovingTabindexController ?. elements || [ ] ;
723- const index = ! ! menuItem ? elements . indexOf ( menuItem ) : - 1 ;
723+ const index = menuItem ? elements . indexOf ( menuItem ) : - 1 ;
724724 let newIndex = Math . min ( Math . max ( 0 , index + diff ) , elements . length - 1 ) ;
725725 while (
726726 ! this . isFocusableElement ( elements [ newIndex ] ) &&
@@ -729,7 +729,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
729729 ) {
730730 newIndex += diff ;
731731 }
732- return ! ! this . isFocusableElement ( elements [ newIndex ] )
732+ return this . isFocusableElement ( elements [ newIndex ] )
733733 ? ( elements [ newIndex ] as MenuItem )
734734 : menuItem || elements [ 0 ] ;
735735 }
@@ -1010,7 +1010,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
10101010 }
10111011 } ) ;
10121012 }
1013- if ( ! ! this . _updateFocus ) {
1013+ if ( this . _updateFocus ) {
10141014 this . rovingTabindexController ?. focusOnItem ( this . _updateFocus ) ;
10151015 this . _updateFocus = undefined ;
10161016 }
0 commit comments