# Long PopUpMenu scroll trouble

**URL:** <https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244>\
**Category:** Uncategorized\
**Created:** [1 November 2020 12:36 UTC](https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244 "2020-11-01T12:36:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSV](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DSV](https://iplug2.discourse.group/u/DSV)\
**Post date:** [1 November 2020 12:36 UTC](https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244/1 "2020-11-01T12:36:58Z")

</div>

Hello! When I tried to use the IPopupMenuControl and make a menu with many items I found that the menu scroll didn’t work properly. In void IPopupMenuControl::Expand(const IRECT& anchorArea) is calculating

```
float maxB = mMaxBounds.B - panelHeight - (mDropShadowSize * 2.f); 

```

and then

```
if ( y > maxB ) y = maxB; 

```

But maxB can be negative and in this case menu scroll doesn’t work. I’m not sure that it was right but I added after that

```
if (y < 0) y = 0;

```

and now the scroll works correctly  
Hope it will helps to someone

Another moment: when I put cursor on scroll button the menu scrolling only to one page. If I need to scroll next I have to move the mouse but not to click

---

<div class="post-metadata">

**Author:** ![bindernews](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bindernews](https://iplug2.discourse.group/u/bindernews)\
**Post date:** [2 November 2020 22:43 UTC](https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244/2 "2020-11-02T22:43:26Z")

</div>

Hi there, please open an issue on the [Github Page](https://github.com/iPlug2/iPlug2) so we can track issue. Also can you please give more details about the scrolling issue? Maybe a few screenshots or steps to reproduce?

Thanks,  
Binder News

---

<div class="post-metadata">

**Author:** ![DSV](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DSV](https://iplug2.discourse.group/u/DSV)\
**Post date:** [3 November 2020 20:30 UTC](https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244/3 "2020-11-03T20:30:38Z")

</div>

Hi!  
I’ll open issue little later but now I can post the screenshots without and with added code string.

When I made the PopupMenu for 40 items

 ![зображення](https://global.discourse-cdn.com/free1/uploads/iplug2/original/1X/c7242c83b4f0da2e9442369b2eb05b83f9b9a4b6.png)

And when I added

```
if (y < 0) y = 0;

```

 ![зображення](https://global.discourse-cdn.com/free1/uploads/iplug2/original/1X/d73217bb6e3bb747135b864b42baab62adc00b3f.png)

Don’t be scared - this project is just some kind of sandbox for trying iPlug features 😄

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [4 November 2020 09:21 UTC](https://iplug2.discourse.group/t/long-popupmenu-scroll-trouble/244/4 "2020-11-04T09:21:23Z")

</div>

Thanks, i think this is a regression when i merged some popup menu changes, since the scrolling worked previously
