Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use validationError classes defined in styles. This way this can be ovewriten by users #1866

Conversation

andresgutgon
Copy link
Contributor

What?

This one is pretty easy. In text inputs errors can be styled.

Example in my code

image

But Radio buttons have a hardcoded string so is not possible.

Solution

Just use the prop we have for this clase

@andresgutgon andresgutgon force-pushed the fix/use-validationError-class-on-radio-buttons branch from 88b2e6b to 0f09faf Compare January 10, 2022 17:34
const divClassNames = `validation ${isValid ? classNames.description : 'validation_error' }`;
const divClassNames = [classNames.validation]
.concat(isValid ? classNames.description : classNames.validationError)
.join(' ');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the same as in the input control

@sdirix
Copy link
Member

sdirix commented Jan 11, 2022

Thanks for this contribution too 😉 We'll take a look very soon!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.242% when pulling 0f09faf on andresgutgon:fix/use-validationError-class-on-radio-buttons into 075bbc4 on eclipsesource:master.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! Thanks for the contribution!

@sdirix sdirix merged commit e9400b6 into eclipsesource:master Jan 11, 2022
@sdirix sdirix added this to the 3.0 milestone Jan 11, 2022
@andresgutgon andresgutgon deleted the fix/use-validationError-class-on-radio-buttons branch January 11, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants