Skip to content

Commit

Permalink
fix: unwanted password show on enter, instead of submit (#225)
Browse files Browse the repository at this point in the history
Adding type="button" to show password button.

Default type of buttons inside a form is always submit, so enter
triggers it.
  • Loading branch information
daro-asecas authored Nov 28, 2023
2 parents 21a9687 + 9b40e3a commit d2300c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions front/share/src/Form/FieldContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
</button> -->
<button
class="btn ripple-container"
type="button"
use:ripple
on:click|preventDefault={() => btn?.action()}
tabindex={btn.tabindex}
Expand Down
3 changes: 1 addition & 2 deletions front/share/src/Form/Password.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
$: btn = {
action,
icon: visible ? mdiEyeOff : mdiEye,
label: visible ? $locale.hide_password : $locale.show_password,
tabindex: -1,
label: visible ? $locale.hide_password : $locale.show_password
}
$: type = visible ? "text" : "password";
Expand Down
2 changes: 1 addition & 1 deletion front/share/src/Form/TextField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let maxlength: number | undefined = void 0;
export let icon: string | null = null;
export let icon_viewbox: string | undefined = void 0;
export let on_change: ((v: string) => void) | null = null;
export let on_change: ((v: string) => void) | null = null;
export let multiline: boolean | undefined = void 0;
export let minrows: number | undefined = void 0;
Expand Down

0 comments on commit d2300c0

Please sign in to comment.