-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Bug Description
When a UI contains a focusable element (e.g., a TextField) and widgets within the mainGroup (e.g., item slots), the focus management behaves incorrectly. If the focus is on the TextField, clicking a widget in mainGroup performs the action but does not transfer or clear the focus from the TextField.
Steps to Reproduce
- Open a GUI that has both a TextField and an item slot within the
mainGroup. - Click on the TextField to give it focus (a cursor should appear).
- Click on the item slot in the
mainGroup. - Try typing on the keyboard.
Expected Behavior
After clicking the item slot, the TextField should lose focus, and keyboard input should no longer be directed to it.
Actual Behavior
The item slot action is performed correctly, but the TextField remains focused. Keyboard input continues to be sent to the TextField.
Analysis
The issue lies in the main container's mouseClicked method. When modularUI.mainGroup.mouseClicked(...) returns true, the parent method returns immediately. This premature return bypasses the code block responsible for updating the focus with this.setFocused(...).
com.lowdragmc.lowdraglib.gui.modular.ModularUIGuiContainer#mouseClicked
