Skip to content

Commit aec3045

Browse files
LitnhJacuzziFlashyReese
authored andcommitted
fix: Properly remove focus from the last focused widget
The previous implementation did not remove focus from the last focused widget when another widget was focused. This caused visual inconsistencies, such as the caret in the search bar persisting even after focus was stolen by another widget. Updated `AbstractFrame::setFocused` to ensure the focus state of the previous widget is cleared correctly. Fixes #123
1 parent 37f3c43 commit aec3045

File tree

1 file changed

+3
-0
lines changed
  • common/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame

1 file changed

+3
-0
lines changed

common/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame/AbstractFrame.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public GuiEventListener getFocused() {
7979

8080
@Override
8181
public void setFocused(@Nullable GuiEventListener focused) {
82+
if (this.focused != null) {
83+
this.focused.setFocused(false);
84+
}
8285
this.focused = focused;
8386
if (this.focusListener != null) {
8487
this.focusListener.accept(focused);

0 commit comments

Comments
 (0)