Make buttons in a modal form have proper type.#25446
Conversation
|
Hmm, I guess I would prefer the respective templates to be fixed, or is this change in JS because of dynamically created modals or something? |
There could be a lot, and there will be new templates and developers would forget to mark buttons as "type=button" again and again.
The problem is, Fomantic recommends to use There could be a more general/transparent solution like what I have done for checkbox/dropdown, but it needs time |
|
I was unable to create a backport for 1.20. @wxiaoguang, please send one manually. 🍵 |
Fix go-gitea#25438 All non-"ok" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Backport #25446 by @wxiaoguang Fix #25438 All non-"ok" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
|
@wxiaoguang ... |
I see and I think I know the problem now. This change should be reverted |
… (go-gitea#25478)" This reverts commit 050c38c.
This reverts commit a954c93.
Replace go-gitea#25446, fix go-gitea#25438 All "cancel" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". This is a complete fix for all modal dialogs. The major change is "modules/aria/modal.js", "devtest" related code is for demo/test purpose. # Conflicts: # routers/web/devtest/devtest.go
Fix #25438
All non-"ok" buttons which do not have "type" should not submit the form, should not be triggered by "Enter".