File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " patch" ,
3+ "comment" : " Merge onKeyDown handlers for MenuGrid component" ,
4+ "packageName" : " @fluentui/react-menu-grid-preview" ,
5+ "email" : " adam.samec@gmail.com" ,
6+ "dependentChangeType" : " patch"
7+ }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
2- import { useMergedRefs , getIntrinsicElementProps , slot } from '@fluentui/react-utilities' ;
2+ import {
3+ useMergedRefs ,
4+ useEventCallback ,
5+ mergeCallbacks ,
6+ getIntrinsicElementProps ,
7+ slot ,
8+ } from '@fluentui/react-utilities' ;
39
410import { useTableCompositeNavigation } from '@fluentui/react-table' ;
511import type { MenuGridProps , MenuGridState } from './MenuGrid.types' ;
@@ -13,6 +19,7 @@ export const useMenuGrid_unstable = (props: MenuGridProps, ref: React.Ref<HTMLDi
1319 const validateNestingRef = useValidateNesting ( 'MenuGrid' ) ;
1420 const triggerId = useMenuContext_unstable ( context => context . triggerId ) ;
1521 const { tableRowTabsterAttribute, tableTabsterAttribute, onTableKeyDown } = useTableCompositeNavigation ( ) ;
22+ const onKeyDown = useEventCallback ( mergeCallbacks ( props . onKeyDown , onTableKeyDown ) ) ;
1623
1724 return {
1825 components : {
@@ -23,9 +30,9 @@ export const useMenuGrid_unstable = (props: MenuGridProps, ref: React.Ref<HTMLDi
2330 ref : useMergedRefs ( ref , validateNestingRef ) ,
2431 role : 'grid' ,
2532 'aria-labelledby' : triggerId ,
26- onKeyDown : onTableKeyDown ,
2733 ...tableTabsterAttribute ,
2834 ...props ,
35+ onKeyDown,
2936 } ) ,
3037 { elementType : 'div' } ,
3138 ) ,
You can’t perform that action at this time.
0 commit comments