# Prevent body from scrolling when dropdown is active

**URL:** https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841
**Category:** UX
**Created:** [June 10, 2015, 10:25am UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841 "2015-06-10T10:25:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [June 10, 2015, 10:25am UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/1 "2015-06-10T10:25:56Z")

</div>

It is really hard to be precise about how much to scroll to reach the end of the dropdown. What usually ends up happening is that I overscroll and the main body starts to scroll.

![](https://global.discourse-cdn.com/meta/original/4X/9/3/4/93495e4164708b44258f438d218dff2815d7255e.gif)

I was thinking if we would want to disable scrolling on the body when the dropdown is active or at least when the mouse is hovering the dropdown.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [June 10, 2015, 1:55pm UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/2 "2015-06-10T13:55:56Z")

</div>

This is more obvious on iPhone and Android mobile devices.

And separately:  
I’ve even seen some iPhone devices scroll the page randomly even though not at the bottom or top of the menu scroll - but this was with some site customisations.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 10, 2015, 3:20pm UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/3 "2015-06-10T15:20:45Z")

</div>

iPhone clearly needs a bunch of full height things …

- search
- hamburger
- composer

I wonder though how relevant this topic is in light of this redesign

> [@Full height, slide out hamburger menu](https://meta.discourse.org/t/full-height-slide-out-hamburger-menu/29789):
>
> Just capturing this as it is a target for Discourse 1.4. Our hamburger menu should be a full-height, slide out from the right. Sort of how Google Inbox does it: This also implies search and notifications should maybe be full height slide outs, too – search is absolutely a right hand panel in Slack, for example – but let’s cross that bridge when we get there I guess?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [June 10, 2015, 3:44pm UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/4 "2015-06-10T15:44:46Z")

</div>

This is interesting. I just tested on Firefox and this problem doesn’t occur.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [June 10, 2015, 7:50pm UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/5 "2015-06-10T19:50:30Z")

</div>

I have Firefox latest.

It doesn’t happen with scrolling at the end of the hamburger. But it does if I scroll inside of Notifications, Search, or Avatar.

It has never bothered me much, but I guess that doesn’t mean it couldn’t be a problem for others.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [June 10, 2015, 11:41pm UTC](https://meta.discourse.org/t/prevent-body-from-scrolling-when-dropdown-is-active/29841/6 "2015-06-10T23:41:45Z")

</div>

I believe this problem might have been mentioned in this Gotcha video by Paul @ 2m15s from back in January:

[![](https://global.discourse-cdn.com/meta/original/4X/c/4/7/c47eefa063213a7950125d5bf4f4a166e06419b5.jpeg "HTTP 203: Gotchas (S1, Ep6)") ](https://www.youtube.com/watch?v=VJQtNxyKJhQ&t=2m15s)

It starts with “Did you know you can’t stop the body from scrolling?”…  
… he mentions there is something coming along the pipeline in “spec land” - but there is now way currently of controlling it.

Obviously - there might be something now because that was 6 months ago.

P.S. other parts of the video are interesting too, worth a watch
