-
Notifications
You must be signed in to change notification settings - Fork 100
[patch] INTENG-22824: fix keyboard access to journeys and remove tabindex=-1 #1122
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
Conversation
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
|
/matter review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds keyboard navigation support for modal dialogs, improving accessibility. The implementation looks good overall with a few minor improvements suggested below.
| if (isTabPressed) { | ||
| console.log("tab pressed"); | ||
| if (e.shiftKey) { | ||
| if (focusElementIdx <= 0) { | ||
| focusElementIdx = focusableContent.length - 1; | ||
| } else { | ||
| focusElementIdx = focusElementIdx - 1; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Code Refactor
Issue: Console.log statements should not be included in production code as they can expose information and impact performance.
Fix: Remove the console.log debug statements.
Impact: Improves code cleanliness and prevents potential information leakage in production.
| if (isTabPressed) { | |
| console.log("tab pressed"); | |
| if (e.shiftKey) { | |
| if (focusElementIdx <= 0) { | |
| focusElementIdx = focusableContent.length - 1; | |
| } else { | |
| focusElementIdx = focusElementIdx - 1; | |
| } | |
| if (isTabPressed) { | |
| if (e.shiftKey) { | |
| if (focusElementIdx <= 0) { | |
| focusElementIdx = focusableContent.length - 1; | |
| } else { | |
| focusElementIdx = focusElementIdx - 1; | |
| } |
| if (isEnterPressed) { | ||
| console.log("enter pressed"); | ||
| // Get the currently focused element | ||
| var focusedElement = document.activeElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Code Refactor
Issue: Console.log statements should not be included in production code as they can expose information and impact performance.
Fix: Remove the console.log debug statement.
Impact: Improves code cleanliness and prevents potential information leakage in production.
| if (isEnterPressed) { | |
| console.log("enter pressed"); | |
| // Get the currently focused element | |
| var focusedElement = document.activeElement; | |
| if (isEnterPressed) { | |
| // Get the currently focused element | |
| var focusedElement = document.activeElement; |
src/branch_view.js
Outdated
| obj = utils.addPropertyIfNotNull(obj, 'no_journeys', options['no_journeys']); | ||
| obj = utils.addPropertyIfNotNull(obj, 'is_iframe', utils.isIframe()); | ||
| obj = utils.addPropertyIfNotNull(obj, 'journey_dismissals', journeyDismissals); | ||
| // obj = utils.addPropertyIfNotNull(obj, 'journey_dismissals', journeyDismissals); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echoing suggestion to remove commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ope yeah, sorry this wasnt fully ready for review
gdeluna-branch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, just some nits
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
Pull Request Template
Description
A customer's automation has found our journeys to not be WCAG compliant because our iframe that we load the journey into has tabindex = -1.
What they think this is doing is making it so that the user can not tab into the journey using the keyboard. The real issues are as follows:
Issue 1: CSS in the journey template
at the bottom of the template (this being the template in the dashboard that the customer has the ability to edit)
what this is doing is making it so that when the journey is tabbed onto, you dont actually see what is being highlighted. In my own template, I updated it to
and now i can see that when tabbing i am actually highlighting onto various parts of the journey.
Issue 2: our handling of keyboard input on the journey
We created special logic to handle tabs in the journey. This function though is handling all keyboard input. So, since it is handling all keyboard input, including enter, but without any specific way to handle enter, then pressing the enter key will not do anything
So, i fix the issue of keyboard input in this PR. I also removed the tabindex and added some other WCAG tags because they dont change anything, but will hopefully make the customer happy.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
JS Budget Check
Please mention the size in kb before abd after this PR
Checklist:
Mentions:
List the person or team responsible for reviewing proposed changes.
cc @BranchMetrics/saas-sdk-devs for visibility.