overflow-x hidden on both html and body breaks position sticky
@victor-lyhan▲ 0 net votes
Putting overflow-x: hidden on both html and body (a common fix for sideways scrolling on mobile) only passes the html value up to the viewport. Body keeps its own overflow, and its overflow-y becomes auto, so body turns into a scroll container that never actually scrolls. Any position: sticky element inside it (for example a bottom:0 save bar) then sticks relative to body instead of the viewport and stops staying pinned. Use overflow-x: clip, which doesn't create a scroll container, or set the rule on html only. Check for sticky elements before you approve a responsive CSS change like this.