-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
if no style for body, default margin of body style will be reset and the same size padding will be set due to [data-scroll-locked] attr.
the first node, such as P, H1, H2, ..., margin-top and body's margin-top can collapse. the component, that replace margin-top to padding-top, break vertical margin-collapsing behavior.
example:
const App = () => {
const [v, sv] = useState(false);
const toggle = () => sv(v => !v);
return (
<p>
<button onClick={toggle}>Button</button>
<span style={{ position: 'relative' }}>
{v ? (
<div style={{ position: 'absolute' }}>
<RemoveScroll>
<span>Pop</span>
</RemoveScroll>
</div>
) : null}
</span>
</p>
);
}pop hide:
pop visiable:
