Menu

📰
0

Dropdowns Inside Scrollable Containers: Why They Break And How To Fix Them Properly

Articles on Smashing Magazine — For Web Designers And Developers·@hellosmashingmagazine.comGodstimeAburu·2 months ago
#MdUnew
#smashingmagazine#englishlanguage
Reading 0:00
15s threshold

The scenario is almost always the same, which is a data table inside a scrollable container. Every row has an action menu, a small dropdown with some options, like **Edit**, **Duplicate**, and **Delete**. You build it, it seems to work perfectly in isolation, and then someone puts it inside that scrollable div and things fall apart. I’ve seen this exact bug in three different codebases: the container, the stack, and the framework, all different. The bug, though, is totally identical. The dropdown gets clipped at the container’s edge. Or it shows up behind content that should logically be below it. Or it works fine until the user scrolls, and then it drifts. You reach for z-index: 9999. Sometimes it helps, but other times it does absolutely nothing. That inconsistency is the first clue that something deeper is happening.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More