-
Notifications
You must be signed in to change notification settings - Fork 58
Focus on first visible field in form and in navigable layouts #1517
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
2372780
to
20ddad4
Compare
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
70a4490
to
7bfb94b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1517 +/- ##
=========================================
Coverage 82.32% 82.32%
Complexity 1000 1000
=========================================
Files 108 108
Lines 2603 2603
Branches 370 370
=========================================
Hits 2143 2143
Misses 272 272
Partials 188 188 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aabb39e
to
b77c7d1
Compare
Accessibility Violations Found
|
|
||
|
||
|
||
const firstVisibleChild = findFirstVisibleEnabledChild(formContainer.getModel()._children) |
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.
Why are you using private API's ? please only use public API from the model
@@ -225,6 +225,21 @@ | |||
panel.classList.add(this.constructor.cssClasses.panel.expanded); | |||
panel.classList.remove(this.constructor.cssClasses.panel.hidden); | |||
panel.setAttribute("aria-hidden", false); | |||
|
|||
if (document.activeElement === button) { |
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.
Why is this code required ? Its not clear, can you add some comments. Since this is part of common.js, this would also execute in authoring, which I don't think we need for this use-case
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.
We want focus on the first field when tab expands so I have integrated it in the expansion logic
ui.frontend/src/view/FormPanel.js
Outdated
|
||
// ... existing code ... | ||
|
||
focusToFirstVisibleField(id) { |
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.
Indent the code and remove the 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.
Removed!
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.
check comments
b7cc690
to
3baa68b
Compare
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
b139482
to
7fb8caa
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
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.
Add repeatability test case, 1st tab repeat, middle tab repeat and the last tab repeat.
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
const tab = this.getModel().getState().items.find(item => item.type === 'array')?.items?.find(subItem => subItem.id === panelId) | ||
const field = form.getElement(tab?.id); | ||
if (field) { | ||
setTimeout(() => {form.setFocus(field)}, 0); |
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.
Why is there setTimeout in the 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.
setTimeout is used because view takes some time to get initialized and in the meantime, set focus happens so it does not create a focus and there is a warning in the console that view is not initialised.
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.
Focus should also be async, we should make use of Focus event here ? I am merging this due to code freeze, but create a backlog JIRA to get rid of setTimeout
}) | ||
}) | ||
}) | ||
// it(" fullName field should update on change in first name and last name ", () => { |
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.
Why is this test case commented, if configuration for EDS is already added
Merging since sakshi approved |
* Merge pull request #1565 from adobe/ver54 update aem base image * Updating toggle bundle (#1566) * FORMS-17107: Client-side custom function parsing changes (#1562) * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: incorporated review comments * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: incorporated review comments * FORMS-17107: incorporated review comments * FORMS-19095: Enable API Call tool UI for both AEM and SPA * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes * FORMS-17107: Client-side custom function parsing changes --------- Co-authored-by: Arun Kumar Attri <[email protected]> * fix: Add null check for span element in radio button component (#1572) Co-authored-by: Shivam Agarwal <[email protected]> * Focus on first visible field in form and in navigable layouts (#1517) Co-authored-by: Pavitra Khatri <[email protected]> * FT_FORMS-17107: disable client-side custom function parsing toggle (#1577) * FT_FORMS-17107: disable client-side custom function parsing toggle * FT_FORMS-17107: update custom function collateral * FORMS-17107: update custom function collateral --------- Co-authored-by: Arun Kumar Attri <[email protected]> --------- Co-authored-by: Rishi Mehta <[email protected]> Co-authored-by: Arun Kumar Attri <[email protected]> Co-authored-by: Shivam Agarwal <[email protected]> Co-authored-by: Shivam Agarwal <[email protected]> Co-authored-by: pavi41 <[email protected]> Co-authored-by: Pavitra Khatri <[email protected]>
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: