Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/components/overlays/MenuLazyProvider/MenuLazyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react';

// Utils
import { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts';
import { mergeCallbacks, mergeRefs } from '../../../util/reactUtil.ts';
import { mergeCallbacks, mergeProps, mergeRefs } from '../../../util/reactUtil.ts';
import { type UseFloatingElementOptions } from '../../util/overlays/floating-ui/useFloatingElement.tsx';

// Components
Expand Down Expand Up @@ -185,11 +185,17 @@ export const MenuLazyProvider = (props: MenuLazyProviderProps) => {
const floatingProps = getFloatingProps({
popover: 'manual',
style: floatingStyles,
...propsRest,
className: cx(cl['bk-menu-provider__list-box'], propsRest.className),
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
className: cx(cl['bk-menu-provider__list-box']),
});

const mergedProps = mergeProps(
floatingProps,
propsRest,
{
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
},
);

const mergedListBoxRef = mergeRefs<React.ComponentRef<typeof ListBoxLazy.ListBoxLazy>>(
listBoxRef,
refs.setFloating,
Expand All @@ -212,8 +218,7 @@ export const MenuLazyProvider = (props: MenuLazyProviderProps) => {
{anchor}
{isMounted && (
<ListBoxLazy.ListBoxLazy
{...floatingProps}
{...propsRest}
{...mergedProps}
ref={mergedListBoxRef}
size={menuSize}
label={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react';

// Utils
import { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts';
import { mergeCallbacks, mergeRefs } from '../../../util/reactUtil.ts';
import { mergeCallbacks, mergeProps, mergeRefs } from '../../../util/reactUtil.ts';
import { type UseFloatingElementOptions } from '../../util/overlays/floating-ui/useFloatingElement.tsx';

// Components
Expand Down Expand Up @@ -178,11 +178,17 @@ export const MenuMultiLazyProvider = (props: MenuMultiLazyProviderProps) => {
const floatingProps = getFloatingProps({
popover: 'manual',
style: floatingStyles,
...propsRest,
className: cx(cl['bk-menu-provider__list-box'], propsRest.className),
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
className: cx(cl['bk-menu-provider__list-box']),
});

const mergedProps = mergeProps(
floatingProps,
propsRest,
{
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
},
);

const mergedListBoxRef = mergeRefs<React.ComponentRef<typeof ListBoxMultiLazy.ListBoxMultiLazy>>(
listBoxRef,
refs.setFloating,
Expand All @@ -207,8 +213,7 @@ export const MenuMultiLazyProvider = (props: MenuMultiLazyProviderProps) => {
{anchor}
{isMounted && (
<ListBoxMultiLazy.ListBoxMultiLazy
{...floatingProps}
{...propsRest}
{...mergedProps}
ref={mergedListBoxRef}
size={menuSize}
label={label}
Expand Down
17 changes: 11 additions & 6 deletions src/components/overlays/MenuMultiProvider/MenuMultiProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react';

// Utils
import { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts';
import { mergeCallbacks, mergeRefs, useRefWithInitializer } from '../../../util/reactUtil.ts';
import { mergeCallbacks, mergeProps, mergeRefs, useRefWithInitializer } from '../../../util/reactUtil.ts';
import {
type UseFloatingElementOptions,
UseFloatingElementResult,
Expand Down Expand Up @@ -597,11 +597,17 @@ export const MenuMultiProvider = Object.assign((props: MenuMultiProviderProps) =
const floatingProps = getFloatingProps({
popover: 'manual',
style: floatingStyles,
...propsRest,
className: cx(cl['bk-menu-provider__list-box'], propsRest.className),
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
className: cx(cl['bk-menu-provider__list-box']),
});

const mergedProps = mergeProps(
floatingProps,
propsRest,
{
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
},
);

const mergedListBoxRef = mergeRefs<React.ComponentRef<typeof ListBoxMulti.ListBoxMulti>>(
listBoxRef,
refs.setFloating,
Expand All @@ -626,8 +632,7 @@ export const MenuMultiProvider = Object.assign((props: MenuMultiProviderProps) =
{anchor}
{isMounted && (
<ListBoxMulti.ListBoxMulti
{...floatingProps}
{...propsRest}
{...mergedProps}
ref={mergedListBoxRef}
size={menuSize}
label={label}
Expand Down
17 changes: 11 additions & 6 deletions src/components/overlays/MenuProvider/MenuProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react';

// Utils
import { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts';
import { mergeCallbacks, mergeRefs } from '../../../util/reactUtil.ts';
import { mergeCallbacks, mergeProps, mergeRefs } from '../../../util/reactUtil.ts';
import {
type UseFloatingElementOptions,
} from '../../util/overlays/floating-ui/useFloatingElement.tsx';
Expand Down Expand Up @@ -191,11 +191,17 @@ export const MenuProvider = Object.assign((props: MenuProviderProps) => {
const floatingProps = getFloatingProps({
popover: 'manual',
style: floatingStyles,
...propsRest,
className: cx(cl['bk-menu-provider__list-box'], propsRest.className),
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
className: cx(cl['bk-menu-provider__list-box']),
});

const mergedProps = mergeProps(
floatingProps,
propsRest,
{
onKeyDown: mergeCallbacks([propsRest.onKeyDown, onMenuKeyDown]),
},
);

const mergedListBoxRef = mergeRefs<React.ComponentRef<typeof ListBox.ListBox>>(
listBoxRef,
refs.setFloating,
Expand All @@ -218,8 +224,7 @@ export const MenuProvider = Object.assign((props: MenuProviderProps) => {
{anchor}
{isMounted && (
<ListBox.ListBox
{...floatingProps}
{...propsRest}
{...mergedProps}
ref={mergedListBoxRef}
size={menuSize}
label={label}
Expand Down