-
Notifications
You must be signed in to change notification settings - Fork 63
FORMS-13392 Role main check #1112
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
0a72737 to
39e6948
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1112 +/- ##
=========================================
Coverage 80.82% 80.82%
Complexity 774 774
=========================================
Files 92 92
Lines 2117 2117
Branches 285 285
=========================================
Hits 1711 1711
Misses 252 252
Partials 154 154 ☔ View full report in Codecov by Sentry. |
39e6948 to
12647a4
Compare
12647a4 to
fe263fc
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
sakshi-arora1
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.
You will also need to honour this in core component container (guidecontainer) component.
The role="main" attribute is typically used for the main content area of a web page, not specifically for form. Why did we add this in container ? Ideally, it should not be present. |
|
@sakshi-arora1, kindly refrain from mentioning internal JIRA IDs here. The issue you provided pertains to a page rather than a form. Ideally, the attribute should be included in the page component, as mentioned previously. This attribute is specifically utilized for the main content area and not for the HTML elements of the form. |
For a standalone form and for form embedded (within iframe), form is the main content of the page, hence role main needs to be added to the container. For form embedded within a div on sites page, role main will not apply. So the fix is to conditionally add. role main. |
I acknowledge the point, but the responsibility of including role="main" in the HTML should lie with the page component rather than the form container. Otherwise, resorting to workarounds like removeRoleMain introduces complexity to the API surface and compromises code readability. |
Page component will not get an opportunity to add role main. Also this is reported in our accessibility report under "Best Practice" -> landmark-one-main |
Could you clarify your statement about the page component not getting an opportunity? While I acknowledge that this is an accessibility issue, I believe the proposed solution for addressing the problem is not accurate. It's acceptable to address this for foundation components in this manner, but for core components, a more refined solution is necessary. The current approach of introducing removeRoleMain appears very hacky and less readable. |
|
merging this since the change
For reference, HTML spec, https://html.spec.whatwg.org/multipage/grouping-content.html#the-main-element ideally this is how the HTML structure should be |
|
@rismehta still not merged
@rismehta still not merged |
* FORMS-13392 role main check added * FORMS-13392 role main check added I --------- Co-authored-by: Rajat Khurana <rajatkhurana@adobe.com>
JIRA for the test Cases: https://jira.corp.adobe.com/browse/FORMS-13508
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: