CSS: Using Overflow Scroll to Quash Bugs
2 min readJun 29, 2018
The Challenge: Navbar dropdown contains a lengthy IA with clipped text that is hidden on multiple browsers. Scrolling down presents another challenge where the dropdown collapses upward.
The Solution:
- Identified the parent div for the dropdown menu by traversing DOM tree and flipping “display:none” on and off. (NOTE: Also noticed expanding navbar height on hover but ruled that behaviour out as a possible cause of the bugs after testing.)
- Found inline CSS on the div setting the behaviour. Confirmed that this was injected by an iMIS script. The approach then turned to using CSS and “!important” commands to overwrite the injected CSS.
- Set a fixed height to the parent div and added an “overflow: scroll” to complete the override.
- Tested the changes on different browsers and device sizes.
- Scrolled up and down the page to identify when the collapse bug appears.
- Using developer tools, noticed a negative pixel Top attribute getting set at a certain point.
- Used a Top override and added to new custom class as shown below: