Skip to content

Commit

Permalink
chore: add both options to useArrowNavigationGroup (#25568)
Browse files Browse the repository at this point in the history
* chore: add both options to useArrowNavigationGroup

* chore: add changes

* chore: update api
  • Loading branch information
chpalac authored Nov 8, 2022
1 parent ef2a48d commit 65b289e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Add both options to axis config",
"packageName": "@fluentui/react-tabster",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const useArrowNavigationGroup: (options?: UseArrowNavigationGroupOptions)

// @public (undocumented)
export interface UseArrowNavigationGroupOptions {
axis?: 'vertical' | 'horizontal' | 'grid';
axis?: 'vertical' | 'horizontal' | 'grid' | 'both';
circular?: boolean;
ignoreDefaultKeydown?: Types.FocusableProps['ignoreKeydown'];
memorizeCurrent?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface UseArrowNavigationGroupOptions {
* Focus will navigate vertically, horizontally or in both directions (grid), defaults to horizontally
* @defaultValue vertical
*/
axis?: 'vertical' | 'horizontal' | 'grid';
axis?: 'vertical' | 'horizontal' | 'grid' | 'both';
/**
* Focus will cycle to the first/last elements of the group without stopping
*/
Expand Down Expand Up @@ -60,6 +60,8 @@ function axisToMoverDirection(axis: UseArrowNavigationGroupOptions['axis']): Typ
return Types.MoverDirections.Horizontal;
case 'grid':
return Types.MoverDirections.Grid;
case 'both':
return Types.MoverDirections.Both;

case 'vertical':
default:
Expand Down

0 comments on commit 65b289e

Please sign in to comment.