-
Notifications
You must be signed in to change notification settings - Fork 58
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
Remove aria-disabled attribute #1411
Conversation
c9ceba3
to
d8b2339
Compare
@@ -450,14 +450,15 @@ class FormFieldBase extends FormField { | |||
* @param {Object} state - The state object. | |||
*/ | |||
updateEnabled(enabled, state) { | |||
const screenReaderText = window.DOMPurify ? window.DOMPurify.sanitize(state.screenReaderText, { ALLOWED_TAGS: [] }) : state.screenReaderText; |
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.
Let's move this code out of FormFieldBase.js. You don't need to remove aria-label attribute here
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.
Done!
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
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
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 #1411 +/- ##
=========================================
Coverage 82.24% 82.24%
Complexity 902 902
=========================================
Files 103 103
Lines 2337 2337
Branches 317 317
=========================================
Hits 1922 1922
Misses 254 254
Partials 161 161 ☔ View full report in Codecov by Sentry. |
b2f4d5c
to
f01871e
Compare
Accessibility Violations Found
|
d231867
to
62ccadb
Compare
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
@@ -74,6 +74,17 @@ | |||
} | |||
} | |||
|
|||
updateEnabled(enabled, state) { | |||
if (this.widget) { | |||
this.element.setAttribute(FormView.Constants.DATA_ATTRIBUTE_ENABLED, enabled); |
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 should be included in FormFieldBase.js, as it's necessary for our runtime, such as setting the disable attribute and its related data attributes. Changes specific to HTML, like aria attributes, should belong to the view layer (i.e., datepickerview.js). You’ll also need to call super.updateEnabled for other functions, essentially invoking the method from FormFieldBase.
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
* @param {boolean} enabled - The enabled state. | ||
* @param {Object} state - The state object. | ||
*/ | ||
updateEnabled(enabled, state) { |
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 had to keep this function.
you just had to remove the following code from this,
this.widget.setAttribute(Constants.ARIA_DISABLED, true);
this.widget.removeAttribute(Constants.ARIA_DISABLED);
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.
Done!
bcb5057
to
510f671
Compare
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
@@ -65,6 +65,10 @@ | |||
return this.element.querySelector(TextInput.selectors.qm); | |||
} | |||
|
|||
updateEnabled(enabled, state) { |
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.
If we are just calling super method here, we might as well delete this from here
5150431
to
c5d690a
Compare
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Co-authored-by: Pavitra Khatri <pavitrakhatri@pavitras-mbp.corp.adobe.com>
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: