From becbb77788255476235faf233fd8dcd8cdc18910 Mon Sep 17 00:00:00 2001 From: Pranay Kothapalli Date: Tue, 23 Jun 2026 18:55:11 +0530 Subject: [PATCH] fix(drawer): merge consumer props through getFloatingProps Pass drawer content props into getFloatingProps instead of overriding floating handlers with a trailing spread. Fixes #806 --- .../ui/Drawer/fragments/DrawerContent.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/ui/Drawer/fragments/DrawerContent.tsx b/src/components/ui/Drawer/fragments/DrawerContent.tsx index 95a470d0b..367a3ed16 100644 --- a/src/components/ui/Drawer/fragments/DrawerContent.tsx +++ b/src/components/ui/Drawer/fragments/DrawerContent.tsx @@ -74,7 +74,19 @@ const DrawerContent = forwardRef(({ // Strip floating-ui's style injection — drawer positioning is owned by CSS // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { style: _ignored = undefined, ...floatingProps } = (getFloatingProps() ?? {}) as any; + const { style: _ignored = undefined, ...floatingProps } = (getFloatingProps({ + ...props, + style: { outline: 'none', ...peekStyle, ...styleProp }, + role, + 'aria-modal': resolvedAriaModal, + 'aria-hidden': !isOpen ? 'true' : undefined, + 'aria-labelledby': isOpen ? ariaLabelledBy : undefined, + 'aria-describedby': isOpen ? ariaDescribedBy : undefined, + 'data-state': dataState, + 'data-swipe-direction': swipeDirection, + 'data-child-open': childOpenCount > 0 ? 'true' : undefined, + className: clsx(rootClass && `${rootClass}-content`, className) + }) ?? {}) as Record; if (!isVisible && !forceMount) return null; @@ -99,17 +111,6 @@ const DrawerContent = forwardRef(({ ref={mergedRef} asChild={asChild} {...floatingProps} - style={{ outline: 'none', ...peekStyle, ...styleProp }} - role={role} - aria-modal={resolvedAriaModal} - aria-hidden={!isOpen ? 'true' : undefined} - aria-labelledby={isOpen ? ariaLabelledBy : undefined} - aria-describedby={isOpen ? ariaDescribedBy : undefined} - data-state={dataState} - data-swipe-direction={swipeDirection} - data-child-open={childOpenCount > 0 ? 'true' : undefined} - className={clsx(rootClass && `${rootClass}-content`, className)} - {...props} > {/* Separate handle children from the rest so CSS can position them on the correct edge regardless of flex-direction */}