# Scrolling into view UMG widget without mouse only works downward

**URL:** <https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875>\
**Category:** UI\
**Tags:** scrollbox, unreal-engine, question, UMG\
**Created:** [September 18, 2017, 1:19pm UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875 "2017-09-18T13:19:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_823992f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_823992f1](https://forums.unrealengine.com/u/anonymous_user_823992f1)\
**Post date:** [September 18, 2017, 1:19pm UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/1 "2017-09-18T13:19:17Z")

</div>

![213879-scrollbug-construct.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/6/15669140f84c636fe02ba1ab9658a5fc040c0182.png)

![213894-scrollbug-widgettree.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/6/bf689b762479b593d7b1b1155e82986cabd1181f.png)

SETUP:

1. In Blueprints creating a Scrollbox in a size box. It containing a uniform grid.
2. The grid is populated with 9 simple custom widgets all in column 0.
3. The blueprint holding all of this listens for DPAD up or DPAD down which decrements and increments a variable used to select one of the 9 custom widgets.
4. After up or down is pressed and the index modified, ScrollWidgetIntoView() is called on the newly selected widget

 ![213880-scrollbug-handlers.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/8/908d83622ec9e07ad7c01af8dfdffac025100582.jpeg)

WHAT HAPPENS:  
Press down, when the next widget is cut off from the list, will properly scroll to the widget. Pressing up does not scroll.

EXPECTED:  
Pressing up will scroll the selected widget into view in the same way it works when scrolling downward.

VARIATIONS:

- This happens whether called ScrollWidgetIntoView() is called from C++ or Blueprints.
- This happens whether “animation scroll” is true or false.
- This happens whether vertical or horizontal scrolling (and horizontal seems to introduce other issues.)

---

<div class="post-metadata">

**Author:** ![CyberKatana](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CyberKatana](https://forums.unrealengine.com/u/CyberKatana)\
**Post date:** [September 19, 2017, 7:03am UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/2 "2017-09-19T07:03:46Z")

</div>

I have the same result after updating to 4.17. Scroll from top to down direction works perfectly, at up direction do not works. When i try again scroll down scroll not work. I think problem in detection of state of widget(in render zone/ not in render zone)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_823992f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_823992f1](https://forums.unrealengine.com/u/anonymous_user_823992f1)\
**Post date:** [September 19, 2017, 12:16pm UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/3 "2017-09-19T12:16:18Z")

</div>

If this affects you, please vote up for visibility. 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3580a01d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3580a01d](https://forums.unrealengine.com/u/anonymous_user_3580a01d)\
**Post date:** [September 20, 2017, 4:32pm UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/4 "2017-09-20T16:32:00Z")

</div>

Seeing the exact same issue and my head hurts a bit looking at the code. Will have a look tomorrow and hopefully make a patch. 😕

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [September 20, 2017, 5:17pm UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/5 "2017-09-20T17:17:22Z")

</div>

Hello fxstronster,

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: [Unreal Engine Issues and Bug Tracker (UE-50084)](https://issues.unrealengine.com/issue/UE-50084)

Make it a great day

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3580a01d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3580a01d](https://forums.unrealengine.com/u/anonymous_user_3580a01d)\
**Post date:** [September 21, 2017, 7:25am UTC](https://forums.unrealengine.com/t/scrolling-into-view-umg-widget-without-mouse-only-works-downward/404875/6 "2017-09-21T07:25:02Z")

</div>

Someone at Epic made some unorthodox math, here is a patch.

The file you want to change is `Engine\Source\Runtime\Slate\Private\Widgets\Layout\SScrollBox.cpp`

```
@@ -433,8 +433,9 @@
 		}
 		else
 		{
- const float WidgetStartPosition = GetScrollComponentFromVector(WidgetGeometry->Geometry.Position);
- const float WidgetEndPosition = GetScrollComponentFromVector(WidgetGeometry->Geometry.Position + WidgetGeometry->Geometry.GetLocalSize());
+ const FVector2D WidgetLocalPosition = MyGeometry.AbsoluteToLocal(WidgetGeometry->Geometry.GetAbsolutePosition());
+ const float WidgetStartPosition = GetScrollComponentFromVector(WidgetLocalPosition);
+ const float WidgetEndPosition = GetScrollComponentFromVector(WidgetLocalPosition + WidgetGeometry->Geometry.GetLocalSize());
 			const float ViewStartPosition = InScrollPadding;
 			const float ViewEndPosition = GetScrollComponentFromVector(MyGeometry.GetLocalSize() - InScrollPadding);

```

This is in UNIX patch format: scroll to line 433, remove lines with `-` in front, add lines with `+`

Will make a PR on GitHub

Make it a great engine.
