Skip to content
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

[Accessibility] Errors are announced as the appear in the manifest editor #4336

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ export class ManifestIconsForm extends LitElement {
p.innerText = error;
p.style.color = "#eb5757";
p.classList.add("error-message");
p.setAttribute('aria-live', 'polite');
insertAfter(p, title!.parentNode!.parentNode);
this.errorCount++;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export class ManifestInfoForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand All @@ -352,6 +353,7 @@ export class ManifestInfoForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand Down Expand Up @@ -379,6 +381,7 @@ export class ManifestInfoForm extends LitElement {
let p = document.createElement('p');
p.innerText = `${field} is required and is missing from your manifest.`;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
insertAfter(div, input!.parentNode!.lastElementChild);
Expand Down Expand Up @@ -417,7 +420,6 @@ export class ManifestInfoForm extends LitElement {
});
this.dispatchEvent(manifestUpdated);
}

}

async handleInputChange(event: InputEvent){
Expand Down Expand Up @@ -475,6 +477,7 @@ export class ManifestInfoForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[fieldName!]++;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ export class ManifestPlatformForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand Down Expand Up @@ -546,6 +547,7 @@ dispatchUpdateEvent(field: string, change: any, removal: boolean = false){
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[fieldName!]++;
});
Expand Down Expand Up @@ -806,6 +808,7 @@ dispatchUpdateEvent(field: string, change: any, removal: boolean = false){
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,12 @@ export class ManifestScreenshotsForm extends LitElement {
if(validation.errors){
validation.errors.forEach((error: string) => {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.classList.add("error-message");
insertAfter(p, title!.parentNode);
this.errorCount++;
p.innerText = error;
p.style.color = "#eb5757";
p.classList.add("error-message");
p.setAttribute('aria-live', 'polite');
insertAfter(p, title!.parentNode);
this.errorCount++;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ export class ManifestSettingsForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand Down Expand Up @@ -470,6 +471,7 @@ export class ManifestSettingsForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[fieldName!]++;
});
Expand Down Expand Up @@ -567,6 +569,7 @@ export class ManifestSettingsForm extends LitElement {
let p = document.createElement('p');
p.innerText = error;
p.style.color = "#eb5757";
p.setAttribute('aria-live', 'polite');
div.append(p);
this.errorMap[field]++;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export class ManifestShareForm extends LitElement {
p.innerText = error;
p.style.color = "#eb5757";
p.classList.add("error-message");
p.setAttribute('aria-live', 'polite');
insertAfter(p, title!.parentNode!.parentNode);
this.errorCount++;
});
Expand Down