Skip to content

Commit

Permalink
spread
Browse files Browse the repository at this point in the history
  • Loading branch information
mltejera committed Nov 7, 2024
1 parent 5ae94a1 commit d3a3161
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type NavDrawerProps = ComponentProps<NavDrawerSlots> &
NavProps & {
/**
* An optional tabster attribute to let consumers override keyboard navigation behavior.
* Note that passing this in will override the default behavior of the component.
* @default axis: 'vertical', circular: true
*/
tabsterDomAttribute?: TabsterDOMAttribute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useNavDrawer_unstable = (props: NavDrawerProps, ref: React.Ref<HTML
},

root: slot.always(
{ ref, ...props, ...(tabsterDomAttributeFromProps ?? defaultFocusAttributes) },
{ ref, ...props, ...{ ...defaultFocusAttributes, ...tabsterDomAttributeFromProps } },
{
// TODO: remove once React v18 slot API is modified
// this is a problem with the lack of support for union types on React v18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ export const Controlled = (props: Partial<NavDrawerProps>) => {

// you can override the default keyboard behavior this way:
const tabsterDomAttribute = useArrowNavigationGroup({
axis: 'vertical', // default
circular: true, // default
tabbable: true, // new value
});

Expand Down

0 comments on commit d3a3161

Please sign in to comment.