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

Pressing 'Enter' on repo settings modals hides the modal #25438

Closed
denyskon opened this issue Jun 22, 2023 · 8 comments · Fixed by #25446 or #25618
Closed

Pressing 'Enter' on repo settings modals hides the modal #25438

denyskon opened this issue Jun 22, 2023 · 8 comments · Fixed by #25446 or #25618
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@denyskon
Copy link
Member

denyskon commented Jun 22, 2023

Description

When trying to delete/transfer/archive a repo from its settings, entering the name and pressing enter, the modal is simply being hidden instead of deleting the repo.

Gitea Version

1.20-nightly

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker rootful

Database

None

@silverwind
Copy link
Member

silverwind commented Jun 22, 2023

This 'Enter not working' affects a number of modals, including the "create tag" from commits page "Operations" button, e.g. we need a general solution.

Screenshot 2023-06-22 at 14 21 33

@silverwind silverwind added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jun 22, 2023
@JakobDev
Copy link
Contributor

Maybe we should ditch our custom solution and should use the new dialog HTML Element. According to Can I Use, it is already supported by 92.86% of the Web Users.

@silverwind
Copy link
Member

Yes, that would be preferred as we can then get rid of the fomantic modal module.

@wxiaoguang
Copy link
Contributor

It's caused by abuse of Fomantic Modal in old code.

I think the new "form-fetch-action" could help and could be a clear solution.

@wxiaoguang
Copy link
Contributor

Will be fixed by Make buttons in a modal form have proper type #25446 (for most)

silverwind added a commit that referenced this issue Jun 23, 2023
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: silverwind <[email protected]>
Co-authored-by: Giteabot <[email protected]>
denyskon pushed a commit to denyskon/gitea that referenced this issue Jun 23, 2023
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 <[email protected]>
Co-authored-by: Giteabot <[email protected]>
lunny pushed a commit that referenced this issue Jun 24, 2023
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 <[email protected]>
@denyskon denyskon reopened this Jul 1, 2023
@delvh
Copy link
Member

delvh commented Jul 1, 2023

Not fixed?

@denyskon denyskon changed the title Pressing 'Enter' on delete repo modal hides the modal Pressing 'Enter' on repo settings modals hides the modal Jul 1, 2023
@denyskon
Copy link
Member Author

denyskon commented Jul 1, 2023

The fix was reverted because it introduced even more problems :/

@wxiaoguang
Copy link
Contributor

The complete fix: Make "cancel" buttons have proper type in modal forms #25618

lunny pushed a commit that referenced this issue Jul 3, 2023
Replace #25446, fix #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.
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Jul 3, 2023
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
lunny pushed a commit that referenced this issue Jul 3, 2023
Replace #25446, fix #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.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
5 participants