Semantic-ui-react: Form field has aria-invalid attribute when error is false

Created on 19 Aug 2020  路  3Comments  路  Source: Semantic-Org/Semantic-UI-React

Bug Report

Steps

Use a form field, for example:
<Form.Field id='form-input-control-error-email' control={Input} label='Email' placeholder='[email protected]' error={false} />

Expected Result

The aria-invalid attribute should not be present (or should be false)

Actual Result

The aria-invalid attribute is set to true:

<input aria-describedby="form-input-control-error-email-error-message" aria-invalid="true" placeholder="[email protected]" id="form-input-control-error-email" type="text">

Version

1.2.0

bug good first issue

All 3 comments

Thanks for reporting. It seems that condition there should be simpler 馃惐

src/collections/Form/FormField.js

    'aria-describedby': ariaDescribedBy,
-   'aria-invalid': error !== undefined ? true : undefined,
+   'aria-invalid': error ? true : undefined,

Would you like to submit a PR?

Done, I added some tests as well

A fix was released in [email protected] 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nolandg picture nolandg  路  3Comments

dilizarov picture dilizarov  路  3Comments

AlvMF1 picture AlvMF1  路  3Comments

devsli picture devsli  路  3Comments

ryanpcmcquen picture ryanpcmcquen  路  3Comments