Never forget type="button" on generated buttons!
Przeczytaj oryginałThe author details a perplexing bug where hitting 'Enter' in a form text field, built with the Mavo framework, was deleting items instead of adding them. The root cause was that dynamically generated <button> elements without an explicit type attribute default to 'submit' inside a form. This caused the first button (a delete button) to be triggered on form submission attempts. The article explains the HTML specification quirk and recommends always adding type="button" to library-generated buttons to prevent such issues.
komentarzy
Brak komentarzy
Bądź pierwszy, który podzieli się swoimi myślami!
Rozszerzenie przeglądarki
Uzyskaj natychmiastowy dostęp do AllDevBlogs z przeglądarki
Tydzień
No top articles yet