fix(form-core): improve validation feedback message for screen readers to make it one sentence (#2471)

This commit is contained in:
gerjanvangeest 2025-11-24 08:39:19 +01:00 committed by GitHub
parent 9a31b1a8db
commit 37b24e51ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 69 additions and 64 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/ui': patch
---
[form-core] improve validation feedback message for screen readers to make it one sentence.

View file

@ -87,11 +87,11 @@ export class LionValidationFeedback extends LocalizeMixin(LitElement) {
${this.feedbackData &&
this.feedbackData.map(
({ message, type, validator }) => html`
<div class="validation-feedback__type">
<span class="validation-feedback__type">
${message && type
? this._localizeManager.msg(`lion-form-core:validation${capitalize(type)}`)
: nothing}
</div>
</span>
${this._messageTemplate({ message, type, validator })}
`,
)}

View file

@ -61,12 +61,12 @@ describe('lion-validation-feedback', () => {
await el.updateComplete;
const validationFeedbackType = el.shadowRoot?.querySelector('.validation-feedback__type');
expect(validationFeedbackType?.textContent?.trim()).to.equal('Error');
expect(validationFeedbackType?.textContent?.trim()).to.equal('Error,');
el.feedbackData = [{ message: 'hello', type: 'info', validator: new AlwaysInvalid() }];
await el.updateComplete;
expect(validationFeedbackType?.textContent?.trim()).to.equal('Info');
expect(validationFeedbackType?.textContent?.trim()).to.equal('Info,');
});
it('it does not share the type if there is no message', async () => {

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Грешка',
validationWarning: 'Предупреждение',
validationSuccess: 'Успех',
validationInfo: 'Информация',
validationError: 'Грешка,',
validationWarning: 'Предупреждение,',
validationSuccess: 'Успех,',
validationInfo: 'Информация,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Chyba',
validationWarning: 'Varování',
validationSuccess: 'Úspěch',
validationInfo: 'Informace',
validationError: 'Chyba,',
validationWarning: 'Varování,',
validationSuccess: 'Úspěch,',
validationInfo: 'Informace,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Fehler',
validationWarning: 'Warnhinweis',
validationSuccess: 'Erfolgreich',
validationInfo: 'Info',
validationError: 'Fehler,',
validationWarning: 'Warnhinweis,',
validationSuccess: 'Erfolgreich,',
validationInfo: 'Info,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Error',
validationWarning: 'Warning',
validationSuccess: 'Success',
validationInfo: 'Info',
validationError: 'Error,',
validationWarning: 'Warning,',
validationSuccess: 'Success,',
validationInfo: 'Info,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Error',
validationWarning: 'Advertencia',
validationSuccess: 'Satisfactorio',
validationInfo: 'Información',
validationError: 'Error,',
validationWarning: 'Advertencia,',
validationSuccess: 'Satisfactorio,',
validationInfo: 'Información,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Erreur',
validationWarning: 'Avertissement',
validationSuccess: 'Succès',
validationInfo: 'Info',
validationError: 'Erreur,',
validationWarning: 'Avertissement,',
validationSuccess: 'Succès,',
validationInfo: 'Info,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Hiba',
validationWarning: 'Figyelmeztetés',
validationSuccess: 'Sikeres',
validationInfo: 'Információ',
validationError: 'Hiba,',
validationWarning: 'Figyelmeztetés,',
validationSuccess: 'Sikeres,',
validationInfo: 'Információ,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Errore',
validationWarning: 'Avvertenza',
validationSuccess: 'Operazione riuscita',
validationInfo: 'Info',
validationError: 'Errore,',
validationWarning: 'Avvertenza,',
validationSuccess: 'Operazione riuscita,',
validationInfo: 'Info,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Fout',
validationWarning: 'Waarschuwing',
validationSuccess: 'Succes',
validationInfo: 'Informatie',
validationError: 'Fout,',
validationWarning: 'Waarschuwing,',
validationSuccess: 'Succes,',
validationInfo: 'Informatie,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Błąd',
validationWarning: 'Ostrzeżenie',
validationSuccess: 'Zrealizowano pomyślnie',
validationInfo: 'Informacja',
validationError: 'Błąd,',
validationWarning: 'Ostrzeżenie,',
validationSuccess: 'Zrealizowano pomyślnie,',
validationInfo: 'Informacja,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Eroare',
validationWarning: 'Atenție',
validationSuccess: 'Succes',
validationInfo: 'Informații',
validationError: 'Eroare,',
validationWarning: 'Atenție,',
validationSuccess: 'Succes,',
validationInfo: 'Informații,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Ошибка',
validationWarning: 'Предупреждение',
validationSuccess: 'Успешно',
validationInfo: 'Информация',
validationError: 'Ошибка,',
validationWarning: 'Предупреждение,',
validationSuccess: 'Успешно,',
validationInfo: 'Информация,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Chyba',
validationWarning: 'Varovanie',
validationSuccess: 'Úspešné',
validationInfo: 'Info',
validationError: 'Chyba,',
validationWarning: 'Varovanie,',
validationSuccess: 'Úspešné,',
validationInfo: 'Info,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: 'Помилка',
validationWarning: 'Попередження',
validationSuccess: 'Успішно',
validationInfo: 'Інформація',
validationError: 'Помилка,',
validationWarning: 'Попередження,',
validationSuccess: 'Успішно,',
validationInfo: 'Інформація,',
};

View file

@ -1,6 +1,6 @@
export default {
validationError: '错误',
validationWarning: '警告',
validationSuccess: '成功',
validationInfo: '信息',
validationError: '错误',
validationWarning: '警告',
validationSuccess: '成功',
validationInfo: '信息',
};