diff --git a/src/AvField.js b/src/AvField.js index 78a76fa..dbe2c88 100644 --- a/src/AvField.js +++ b/src/AvField.js @@ -89,6 +89,7 @@ export default class AvField extends Component { size={size} disabled={disabled} readOnly={readOnly} + aria-describedby={validation.errorMessage ? `${id}-error` : undefined} {...attributes} > {children} @@ -96,7 +97,7 @@ export default class AvField extends Component { const validation = this.context.FormCtrl.getInputState(this.props.name); - const feedback = validation.errorMessage ? ({validation.errorMessage}) : null; + const feedback = validation.errorMessage ? ({validation.errorMessage}) : null; const help = helpMessage ? ({helpMessage}) : null; const inputRow = row ? {input}{feedback}{help} : input; const check = attributes.type === 'checkbox';