reach/reach-ui

[dialog] Opening dialog overrides padding on the body element

Open

#610 opened on Jun 9, 2020

View on GitHub
 (7 comments) (1 reaction) (0 assignees)TypeScript (558 forks)auto 404
Help WantedType: Enhancement

Repository metrics

Stars
 (5,975 stars)
PR merge metrics
 (PR metrics pending)

Description

🐛 Bug report

Current Behavior

When the dialog is open, react-remove-scroll via react-remove-scroll-bar, sets some css properties on the body. One of them is padding-top which is set to 0. We need to not do that for our page layout to not break.

We use a sticky masthead which the underlying content uses a padding top value on the body to not be obscured by the masthead.

When react-remove-scroll-bar removed the top padding, the top of the content is under the masthead and the bottom of the page jumps up.

https://share.getcloudapp.com/JruLNJ1j

Expected behavior

react-remove-scroll-bar does allow you to prevent or override some of these css properties. I should be able to pass dialog some control to prevent this from happening.

Suggested solution(s)

expose some react-remove-scroll-bar props to override the behavior.

Your environment

https://www.twilio.com/console/iot/supersim/network-access-profiles

Contributor guide