-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Validation className #158
Comments
Hi @spostad7 , You can pass a This: <EdiText {...otherprops} validation={v => v.length > 5} validationMessage={'invalid value'} /> Or this: <EdiText
{...otherprops}
validation={v => v.length > 5}
validationMessage={<span className="invalid-value-message">Invalid Value</span>}
/> Or even this: function renderValidationMessage() {
return <div className="invalid-value">Invalid Value.</div>
}
<EdiText {...otherprops} validation={v => v.length > 5} validationMessage={renderValidationMessage()} /> |
That's perfectly fine! |
@alioguzhan , <Editor
type="textarea"
value={
state.companyOverviewDescription ||
'------'
}
validation={(val) =>
val.length < descriptionLimit
}
validationMessage={
<div className="invalid-feedback">
{
t('validation.max', {
count: descriptionLimit
}) as string
}
</div>
}
onSave={(val) =>
handleUpdate({
companyOverviewDescription: val
})
}
/> |
Can you make a codesandbox reproduces this behavior, so I can check it on a full working example ? Thanks |
This is because of the same reason as #159? if so we can close this as well for now. |
For somehow for textarea type you are correct, as you said we can not have validation on controlled save button on pressing Enter. But it's been more advance if we could completely overwrite validation tag with custom validation message rather than insert new tag into current tag, because it has its own style and may conflict with it's children style... |
Ok so for backward compatibility, I can't remove the existing validation content container. But I added a new attribute div[editext='validation-container'] {
color: #d3d3d3;
text-decoration: underline;
} Note: Please try this and let me know if that works. |
@all-contributors add @spostad7 for ideas. |
I've put up a pull request to add @spostad7! 🎉 |
Thanks for this brilliant library,
I wonder how could it possible to customize validation message with className or something to style it?
I need to edit some style in validation message (font. color, ....)
The text was updated successfully, but these errors were encountered: