refactor: enhanced Join Private Lobby form (#3284)

## Description:
This pull request enhances the `JoinLobbyModal` component by using the
`<form>` component and the `@submit` event. It allows the user to use
the enter (return) key to submit instead of grabbing its mouse to click
on "Join Lobby".
It also introduces a new `submit` argument to the `Button` component.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:
@nolhan__

PS: The tests from `tests/InputHandler.test.ts` are failing on both
`main` and my branch. EDIT: They no longer fail through the workflow so
I guess I didn't have the correct environment
This commit is contained in:
Nolhan
2026-02-23 20:02:24 +01:00
committed by GitHub
parent 4788316504
commit e5ce278cb1
2 changed files with 6 additions and 3 deletions
@@ -12,6 +12,7 @@ export class OButton extends LitElement {
@property({ type: Boolean }) blockDesktop = false;
@property({ type: Boolean }) disable = false;
@property({ type: Boolean }) fill = false;
@property({ type: Boolean }) submit = false;
private static readonly BASE_CLASS =
"bg-blue-600 hover:bg-blue-700 text-white font-bold uppercase tracking-wider px-4 py-3 rounded-xl transition-all duration-300 transform hover:-translate-y-px outline-none border border-transparent text-center text-base lg:text-lg whitespace-normal break-words leading-tight overflow-hidden relative";
@@ -38,6 +39,7 @@ export class OButton extends LitElement {
<button
class=${classMap(this.getButtonClasses())}
?disabled=${this.disable}
type=${this.submit ? "submit" : "button"}
>
<span class="block min-w-0">
${this.translationKey === ""