Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button default type #355

Closed
g-contaldi opened this issue May 23, 2024 · 1 comment · Fixed by #366
Closed

Button default type #355

g-contaldi opened this issue May 23, 2024 · 1 comment · Fixed by #366
Assignees
Labels

Comments

@g-contaldi
Copy link

g-contaldi commented May 23, 2024

Comportamento atteso

Mi aspetterei che il type di default dei button sia button

Comportamento attuale

ItButtonDirective, non avendo un type di default impostato, e quindi prendendo il default del browser che per la maggior parte è submit, crea malfunzionamenti per button che sono all'interno di <form>. Mi è capitato che alla pressione del taso invio in qualsiasi punto del form andasse sul primo button che trova, che nel mio caso è quello di "Annulla", facendomi uscire dal form.

Possibili soluzioni

Consiglio di implementare su ItButtonDirective un type di default che sia impostato a button:

  /**
   * The type attribute
   * @default button
   */
  @Input() @HostBinding('type') type: 'button' | 'reset' | 'submit' = 'button';

In modo poi dai impostare type="submit" solamente sui button che effettivamente fanno il submit di form.

@AntoninoBonanno AntoninoBonanno self-assigned this Jul 7, 2024
AntoninoBonanno added a commit that referenced this issue Jul 7, 2024
@astagi astagi closed this as completed in ea19950 Jul 12, 2024
github-actions bot pushed a commit that referenced this issue Jul 15, 2024
## [1.0.3](v1.0.2...v1.0.3) (2024-07-15)

### Bug Fixes

* **button:** added default button type ([ea19950](ea19950)), closes [#355](#355)
* multiple initialization ([39fad60](39fad60))
* **popover:** fixed popover container attribute ([6327e76](6327e76)), closes [#352](#352)
* top on sticky header and add method for close NavBar on mobile ([d1df044](d1df044))

### Features

* add regex for italian plate and set plate validators ([be076df](be076df))
* added output event ([f29bfd3](f29bfd3))
* **timeline:** added timeline component ([147b8f5](147b8f5))
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants