@@ -341,41 +341,25 @@ export function useSelectableCollection(options: AriaSelectableCollectionOptions
341341 } ;
342342
343343
344+ let withShiftSel = ( key , callback ) => {
345+ return {
346+ [ key + '+Shift+Sel' ] : callback ,
347+ [ key + '+Shift' ] : callback ,
348+ [ key + '+Sel' ] : callback ,
349+ [ key ] : callback
350+ } ;
351+ } ;
344352 let { keyboardProps} = useKeyboard ( {
345353 ignorePortalRef : ref as RefObject < Element > ,
346354 shortcuts : {
347- 'ArrowDown+Shift+Sel' : arrowDown ,
348- 'ArrowDown+Shift' : arrowDown ,
349- 'ArrowDown+Sel' : arrowDown ,
350- 'ArrowDown' : arrowDown ,
351- 'ArrowUp+Shift+Sel' : arrowUp ,
352- 'ArrowUp+Shift' : arrowUp ,
353- 'ArrowUp+Sel' : arrowUp ,
354- 'ArrowUp' : arrowUp ,
355- 'Home+Shift+Sel' : home ,
356- 'Home+Shift' : home ,
357- 'Home+Sel' : home ,
358- 'Home' : home ,
359- 'ArrowLeft+Shift+Sel' : arrowLeft ,
360- 'ArrowLeft+Shift' : arrowLeft ,
361- 'ArrowLeft+Sel' : arrowLeft ,
362- 'ArrowLeft' : arrowLeft ,
363- 'ArrowRight+Shift+Sel' : arrowRight ,
364- 'ArrowRight+Shift' : arrowRight ,
365- 'ArrowRight+Sel' : arrowRight ,
366- 'ArrowRight' : arrowRight ,
367- 'End+Shift+Sel' : end ,
368- 'End+Shift' : end ,
369- 'End+Sel' : end ,
370- 'End' : end ,
371- 'PageDown+Shift+Sel' : pageDown ,
372- 'PageDown+Shift' : pageDown ,
373- 'PageDown+Sel' : pageDown ,
374- 'PageDown' : pageDown ,
375- 'PageUp+Shift+Sel' : pageUp ,
376- 'PageUp+Shift' : pageUp ,
377- 'PageUp+Sel' : pageUp ,
378- 'PageUp' : pageUp ,
355+ ...withShiftSel ( 'ArrowDown' , arrowDown ) ,
356+ ...withShiftSel ( 'ArrowUp' , arrowUp ) ,
357+ ...withShiftSel ( 'ArrowLeft' , arrowLeft ) ,
358+ ...withShiftSel ( 'ArrowRight' , arrowRight ) ,
359+ ...withShiftSel ( 'Home' , home ) ,
360+ ...withShiftSel ( 'End' , end ) ,
361+ ...withShiftSel ( 'PageDown' , pageDown ) ,
362+ ...withShiftSel ( 'PageUp' , pageUp ) ,
379363 'a+Sel' : aHandler ,
380364 'Escape' : escape ,
381365 'Tab' : tab ,
0 commit comments