Description

This is an edge case occurring when changing Input Mode while the Scroll Box is being dragged. When the Input Mode switches to Game Only, further drag actions are no longer possible. However, because SScrollBar::bDraggingThumb remains set to True, the style does not revert from the Dragged Thumb Image state.

Workaround:
Consider using the following code to force a MouseUp event broadcast when calling Set Input Mode Game Only:

void SimulateMouseButtonUp()
{
    FSlateApplication& SlateApp = FSlateApplication::Get();
    FPointerEvent MouseUpEvent(
        0,
        SlateApp.CursorPointerIndex,
        SlateApp.GetCursorPos(),
        SlateApp.GetLastCursorPos(),
        SlateApp.GetPressedMouseButtons(),
        EKeys::LeftMouseButton,
        0,
        SlateApp.GetPlatformApplication()->GetModifierKeys()
    );
    SlateApp.ProcessMouseButtonUpEvent(MouseUpEvent);
} 
Steps to Reproduce
  1. Create a UMG widget containing a Scroll Box.
  2. Set the Scroll Box’s Style > Bar Style > Dragged Thumb Image to a noticeable color.
  3. Construct a level blueprint:
    1. Display this UMG widget at Begin Play.
    2. Then, execute Set Input Mode UI Only and enable Show Mouse Cursor to display the cursor.
    3. Add a Delay node (a few seconds), then execute Set Input Mode Game Only.
  4. Compile the blueprint.
  5. Run the game, drag (hold) the scrollbar, and wait for ** Set Input Mode Game Only to execute.

Expected Result: After Set Input Mode Game Only is executed, the player loses interaction with the UI, and the Scroll Box should revert to its default state.

Actual Result: The Scroll Box remains in the "dragged" state even after releasing the mouse, with no response.

The repro project is attached. Run the game and hold the vertical scrollbar for 3 seconds. A video is also provided.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-229252 in the post.

0
Login to Vote

Unresolved
ComponentUE - Editor - UI Systems - Slate
Affects Versions5.4
Target Fix5.6
CreatedOct 31, 2024
UpdatedNov 20, 2024
View Jira Issue