godotengine / godotengine/godot
ScrollContainer continues to drag after OptionButton popup closes when mouse_filter is PASS
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: 4.7.1.stable, 4.6.3.stable, 4.5.2.stable, 4.0.1.stable
- Not reproducible in: 3.5.stable
### System information
Godot v4.7.1.stable.mono - Windows 11 (build 28120) - Multi-window, 1 monitor - Direct3D 12 (Mobile) - dedicated NVIDIA GeForce RTX 4050 Laptop GPU (NVIDIA; 32.0.16.1074) - 12th Gen Intel(R) Core(TM) i5-12450H (12 threads) - 39.72 GiB memory - WASAPI (48000 Hz, Stereo/mono)
### Issue description
I encountered an issue with ScrollContainer when it contains an OptionButton whose mouse_filter is set to PASS.
I think the OptionButton's popup window is consuming the mouse release event. Since the release event is lost, the ScrollContainer never receives it and stays in a "dragging" state indefinitely.
https://github.com/user-attachments/assets/276c7dd7-7ac6-467d-9e78-6e9257ce852b
### Steps to reproduce
1. Enable ProjectSettings.input_devices/pointing/emulate_touch_from_mouse.
2. Create a ScrollContainer with enough content to be scrollable.
3. Add an OptionButton as a child of the ScrollContainer.
4. Set the OptionButton's mouse_filter to PASS.
5. Run the project. Click and drag on the OptionButton to start scrolling the ScrollContainer.
6. Click on the OptionButton to open its dropdown menu, then select an item to close the menu
7. Release the mouse button, and the ScrollContainer continue dragging
### Minimal reproduction project (MRP)
[test.zip](https://github.com/user-attachments/files/30409179/test.zip)
Contributor guide
Research direction
Start by running the attached minimal reproduction project and trace input handling between ScrollContainer, OptionButton, and its popup when emulate_touch_from_mouse is enabled. Confirm the missing release leaves scrolling active, then use the existing GUI input-handling tests or add coverage so selecting an item and releasing the mouse reliably ends the drag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100