Skip to content

Conversation

vivian-xu
Copy link
Contributor

Add keydown event to the pod dropdown menu

Fixes #20829

Before: No response to pressing the tab menu after clicking an item in the pod menu

After: Click on an item in the pod menu and press menu focus

Action Details Focus:
image

Action Delete Focus:
image

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@vivian-xu vivian-xu requested a review from a team as a code owner November 29, 2024 01:52
Copy link

bunnyshell bot commented Nov 29, 2024

❗ Preview Environment undeploy from Bunnyshell failed

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to try again to remove the environment

@vivian-xu vivian-xu force-pushed the feat/pod-actions-with-focus branch from ee77d25 to 2eac281 Compare November 29, 2024 01:54
@@ -656,13 +656,25 @@ export function renderResourceMenu(
{items.map((item, i) => (
<li
className={classNames('application-details__action-menu', {disabled: item.disabled})}
tabIndex={0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it always 0? Should it be i?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabindex="0" means that the element should be focusable in sequential keyboard navigation, after any positive tabindex values. The focus navigation order of these elements is defined by their order in the document source.

onKeyDown={e => {
if (e.keyCode === 13 || e.key === 'Enter') {
e.stopPropagation();
if (!item.disabled) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the current button is disabled, I think it shouldn't receive focus. Maybe we should just skip it.🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed the better way!

@andrii-korotkov-verkada
Copy link
Contributor

Looks good, just fix DCO.

Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
@vivian-xu vivian-xu force-pushed the feat/pod-actions-with-focus branch from 56bf1c7 to 7dba696 Compare December 2, 2024 07:28
@vivian-xu
Copy link
Contributor Author

Looks good, just fix DCO.

DCO has been fixed.

@agaudreault agaudreault merged commit 2dafcba into argoproj:master May 8, 2025
28 checks passed
LyhengTep pushed a commit to LyhengTep/argo-cd that referenced this pull request May 10, 2025
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
ranakan19 pushed a commit to ranakan19/argo-cd that referenced this pull request May 20, 2025
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
Signed-off-by: Kanika Rana <krana@redhat.com>
olivergondza pushed a commit to olivergondza/argo-cd that referenced this pull request May 20, 2025
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
Signed-off-by: Oliver Gondža <ogondza@gmail.com>
tylerrosnett pushed a commit to StateFarmIns/argo-cd that referenced this pull request May 27, 2025
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
chansuke pushed a commit to chansuke/argo-cd that referenced this pull request Jun 4, 2025
Signed-off-by: vivian.zhang <vivian.zhang@daocloud.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Pressing <tab> after one clicks on an item that reveals a menu should focus the menu
6 participants