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

Correctly query the primary button in a form #32438

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Nov 6, 2024

The "primary button" is used at many places, but sometimes they might conflict (due to button switch, hidden panel, dropdown menu, etc).

Sometimes we could add a special CSS class for the buttons, but sometimes not (see the comment of QuickSubmit)

This PR introduces querySingleVisibleElem to help to get the correct primary button (the only visible one), and prevent from querying the wrong buttons.

Fix #32437

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 6, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 6, 2024
@wxiaoguang wxiaoguang added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Nov 6, 2024
@wxiaoguang wxiaoguang added this to the 1.23.0 milestone Nov 6, 2024
web_src/js/utils/dom.ts Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 6, 2024
web_src/js/utils/dom.ts Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 6, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Nov 6, 2024
@lunny lunny merged commit b573512 into go-gitea:main Nov 6, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Nov 6, 2024
@wxiaoguang wxiaoguang deleted the fix-form-button branch November 7, 2024 02:06
zjjhot added a commit to zjjhot/gitea that referenced this pull request Nov 7, 2024
* giteaofficial/main:
  Add new index for action to resolve the performance problem (go-gitea#32333)
  Include file extension checks in attachment API (go-gitea#32151)
  Updated tokenizer to better matching when search for code snippets (go-gitea#32261)
  Correctly query the primary button in a form (go-gitea#32438)

# Conflicts:
#	web_src/js/utils/dom.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue editing doesn't work
4 participants