a11y: add alert role when displaying errors in live validation (#76958)
gitea/wcs/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2024-03-25 15:13:37 +01:00
parent 4d5b309986
commit 928b9a66cb
1 changed files with 1 additions and 0 deletions

View File

@ -1022,6 +1022,7 @@ const LiveValidation = (function(){
}
const errorElMessage = document.getElementById(`error_${this.name}_${errorType}`).innerHTML
this.errorEl.setAttribute('role', 'alert')
this.errorEl.innerHTML = errorElMessage
if(overrideMsg) {
const errorMessageContainer = this.errorEl.querySelector(`#error_${this.name}_${errorType}_message`)