Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

fix: pass props through InnerBodyScrollLock component #88

Merged
merged 2 commits into from
May 27, 2020
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion src/Modal/BodyScrollLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function useScrollLockStyles({isLocked}) {
}

function InnerBodyScrollLock(props, ref) {
const {as: Component = 'div', children, style} = props;
const {as: Component = 'div', children, style, ...rest} = props;
const modalStack = useContext(ModalStackContext);
const hasModal = modalStack?.length;
const bodyLockStyles = useScrollLockStyles({isLocked: hasModal});
Expand All @@ -44,6 +44,7 @@ function InnerBodyScrollLock(props, ref) {
<Component
ref={ref}
style={style ? {...style, ...bodyLockStyles} : bodyLockStyles}
{...rest}
>
{children}
</Component>
Expand Down