Skip to content

Caret not deactivating on its own #2725

Open
@rayakame

Description

@rayakame

When adding 2 UI Elements (arcade.gui.UIInputText) the first one stays active even though the user clicked on the second one.

Code for the video below
class LoginMenu(BaseGUI):
    def __init__(self, window: MainWindow, background_color: Color | None = None) -> None:
        super().__init__(window=window)
        self._background_color = background_color

        self._button_width = (c.MENU_WIDTH - c.MENU_SPACING) / 2

        self.grid = arcade.gui.UIGridLayout(
            column_count=2, row_count=3, horizontal_spacing=c.MENU_SPACING, vertical_spacing=c.MENU_SPACING
        )
        self.anchor = self.ui.add(arcade.gui.UIAnchorLayout())

        username_field = arcade.gui.UIInputText(width=self._button_width)
        password_field = arcade.gui.UIInputText(width=self._button_width)

        self.grid.add(arcade.gui.UILabel(text="Username:", width=self._button_width), column=0, row=0)
        self.grid.add(username_field, column=1, row=0)
        self.grid.add(arcade.gui.UILabel(text="Password:", width=self._button_width), column=0, row=1)
        self.grid.add(password_field, column=1, row=1)

        self.anchor.add(anchor_y=c.Alignment.CENTER, anchor_x=c.Alignment.CENTER, child=self.grid)
20250605-1329-58.4926910.mp4

As far as I understood this is a problem with the event handler, and the Mouse Press event not being triggered for the Text Input that should be disabled.

The full conversation until now about the issue can be found on the discord.

@eruvanos is working on this issue as far as I know and knows more about it.

Metadata

Metadata

Assignees

Labels

guiRelated to arcade GUI (sub module arcade.gui)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions