Skip to content

Commit

Permalink
Extract "key" from removeScrollProps
Browse files Browse the repository at this point in the history
  • Loading branch information
brycefranzen committed Jun 24, 2024
1 parent 29f24e3 commit 6a88826
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export const ModalBase = forwardRef<HTMLDivElement, ModalBaseProps>(
const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =
useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });

const { key: removeScrollKey, ...otherRemoveScrollProps } = removeScrollProps || {};

return (
<OptionalPortal {...portalProps} withinPortal={withinPortal}>
<ModalBaseProvider
Expand All @@ -125,7 +127,11 @@ export const ModalBase = forwardRef<HTMLDivElement, ModalBaseProps>(
unstyled,
}}
>
<RemoveScroll enabled={shouldLockScroll && lockScroll} {...removeScrollProps}>
<RemoveScroll
enabled={shouldLockScroll && lockScroll}
key={removeScrollKey}
{...otherRemoveScrollProps}
>
<Box
ref={ref}
{...others}
Expand Down

0 comments on commit 6a88826

Please sign in to comment.