chore: remove redundant check in getElementAccessibleErrorMessage
This commit is contained in:
parent
a2b8124bfb
commit
00b41eb8d3
|
|
@ -475,9 +475,7 @@ export function getElementAccessibleErrorMessage(element: Element): string {
|
||||||
const isAriaInvalid = ariaInvalid !== null && ariaInvalid.toLowerCase() !== 'false';
|
const isAriaInvalid = ariaInvalid !== null && ariaInvalid.toLowerCase() !== 'false';
|
||||||
if (isAriaInvalid) {
|
if (isAriaInvalid) {
|
||||||
const errorMessageId = element.getAttribute('aria-errormessage');
|
const errorMessageId = element.getAttribute('aria-errormessage');
|
||||||
if (errorMessageId) {
|
|
||||||
const errorMessages = getIdRefs(element, errorMessageId);
|
const errorMessages = getIdRefs(element, errorMessageId);
|
||||||
if (errorMessages.length) {
|
|
||||||
const parts = errorMessages.map(errorMessage => asFlatString(
|
const parts = errorMessages.map(errorMessage => asFlatString(
|
||||||
getTextAlternativeInternal(errorMessage, {
|
getTextAlternativeInternal(errorMessage, {
|
||||||
visitedElements: new Set(),
|
visitedElements: new Set(),
|
||||||
|
|
@ -486,8 +484,6 @@ export function getElementAccessibleErrorMessage(element: Element): string {
|
||||||
));
|
));
|
||||||
accessibleErrorMessage = parts.join(' ').trim();
|
accessibleErrorMessage = parts.join(' ').trim();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
cache?.set(element, accessibleErrorMessage);
|
cache?.set(element, accessibleErrorMessage);
|
||||||
}
|
}
|
||||||
return accessibleErrorMessage;
|
return accessibleErrorMessage;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue