Skip to content

Improve tab navigation flow for accessibility#1359

Merged
NorbertLoh merged 3 commits intoCATcher-org:masterfrom
e1121208:improve-tab-navigation
Jul 25, 2025
Merged

Improve tab navigation flow for accessibility#1359
NorbertLoh merged 3 commits intoCATcher-org:masterfrom
e1121208:improve-tab-navigation

Conversation

@e1121208
Copy link
Copy Markdown
Contributor

@e1121208 e1121208 commented Jun 28, 2025

Restructured tabindex order to ensure a logical navigation sequence: focus now moves from the issue title to the description field, followed by the severity and type dropdowns, then the submit button before reaching less important form elements. Enhances usability for keyboard users and improves overall accessibility.

Summary:

Fixes #1266

Changes Made:

  • Reordered the tab navigation sequence in the New Issue form for improved accessibility and user experience.
  • Ensured that pressing Tab now correctly moves focus from the issue title input to the description editor, followed by the severity and type dropdowns, then finally the submit button.

ScreenRecording2025-07-09at12 23 01AM-ezgif com-video-to-gif-converter

Proposed Commit Message:

Improve tab navigation flow for accessibility

Restructured tabindex order to ensure a logical navigation sequence:
focus now moves from the issue title to the description field, followed
by the severity and type dropdowns, then the submit button before reaching less important form
elements. Enhances usability for keyboard users and improves overall
accessibility.

Restructured tabindex order to ensure a logical navigation sequence:
focus now moves from the issue title to the description field, followed
by the severity and type dropdowns, before reaching less important form
elements. Enhances usability for keyboard users and improves overall
accessibility.
@damithc damithc requested a review from Copilot July 7, 2025 06:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR restructures the tab navigation sequence in the New Issue form, ensuring focus flows from the title to the description editor, then to the severity/type dropdowns for improved keyboard accessibility.

  • Adds tabindex="1" to the issue title input.
  • Adds tabindex="2" to the description textarea.
  • Adds tabindex="3" to the dropdown component.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/app/phase-bug-reporting/new-issue/new-issue.component.html Sets tabindex="1" on the title input
src/app/shared/comment-editor/comment-editor.component.html Sets tabindex="2" on the textarea
src/app/shared/label-dropdown/label-dropdown.component.html Sets tabindex="3" on the mat-select

<form [formGroup]="dropdownForm">
<mat-form-field style="width: 100%">
<mat-select
tabindex="3"
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Hardcoding a positive tabindex in a reusable component can lead to focus order conflicts if multiple instances appear. Consider making this value configurable via an @input() or relying on the natural DOM order to maintain sequence.

Copilot uses AI. Check for mistakes.
@@ -13,6 +13,7 @@
<mat-form-field appearance="outline" style="width: 100%">
<mat-label></mat-label>
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

The is empty, leaving the textarea without a visible label for assistive technologies. Add descriptive text inside the label (e.g., "Description") or use an aria-label to improve screen reader accessibility.

Suggested change
<mat-label></mat-label>
<mat-label>Enter your comment</mat-label>

Copilot uses AI. Check for mistakes.
<div class="column left">
<mat-form-field>
<input id="title" formControlName="title" matInput placeholder="Title" required maxlength="256" />
<input id="title" formControlName="title" matInput placeholder="Title" required maxlength="256" tabindex="1"/>
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Using positive tabindex values increases maintenance complexity and can conflict with natural tab order. It's generally better to reorder elements in the DOM to achieve the desired focus flow instead of hardcoding tabindex.

Suggested change
<input id="title" formControlName="title" matInput placeholder="Title" required maxlength="256" tabindex="1"/>
<input id="title" formControlName="title" matInput placeholder="Title" required maxlength="256"/>

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@NorbertLoh NorbertLoh left a comment

Choose a reason for hiding this comment

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

Perhaps you can consider adding tab index to the submit button such that users can navigate the entire flow 1 time. Might be good to align the git commit message to align with others. 👍

@e1121208
Copy link
Copy Markdown
Contributor Author

e1121208 commented Jul 8, 2025

Hi @NorbertLoh, definitely will implement your suggestion. Sorry for any inconvenience but may I ask what may be aligning the git commit message to others mean? Would it be to follow the convention done by the mass majority?

@NorbertLoh
Copy link
Copy Markdown
Contributor

Hi @NorbertLoh, definitely will implement your suggestion. Sorry for any inconvenience but may I ask what may be aligning the git commit message to others mean? Would it be to follow the convention done by the mass majority?

Alls good. I have left a comment on your other PR with an example 👍

@e1121208
Copy link
Copy Markdown
Contributor Author

e1121208 commented Jul 8, 2025

Yes, will do the same for this pull request after I have implemented in your suggestion. Thank you!

Added a tabindex for the submit button for better UX as users can
now complete the entire flow of reporting an issue faster and without
lifting their fingers away from the keyboard
@e1121208
Copy link
Copy Markdown
Contributor Author

e1121208 commented Jul 8, 2025

@NorbertLoh Now, the tab navigation flow allows user to complete reporting an issue faster and without lifting the fingers away from the keyboard.

ScreenRecording2025-07-09at12 10 18AM-ezgif com-video-to-gif-converter

Copy link
Copy Markdown
Contributor

@NorbertLoh NorbertLoh left a comment

Choose a reason for hiding this comment

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

LGTM!

@NorbertLoh NorbertLoh merged commit e251e78 into CATcher-org:master Jul 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve CATcher's tab navigation

3 participants