-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(validation): delegate validation rendering to custom elements #432
feat(validation): delegate validation rendering to custom elements #432
Conversation
Custom elements will be able to take control over validation by defining rendering methods on a DOM element
@MaximBalaganskiy This is a great idea! The element itself always knows best how it should be rendered. 👍 I wondered if |
My initial idea was to keep everything on an element but those two methods will be called from almost every class so to follow DRY I put them on the renderer. |
Yes, I agree. If the element needs some custom behaviour it just wouldn't call |
@MaximBalaganskiy Is there anything to add/discuss here (apart from other components like select)? |
We've also got a date picker to convert, other than that I don't see anything else to add |
Before the change mdRenderValidateResult function was called for each validation result which worked fine while validation messages were displayed. The problem was that validation border was shown based on a presence of validation messages. It there were none - no error border. To fix the issue an element must have all the validation results and render them all at once.
Default rendering functions are called for elements which do not provide their own. Effectively, only INPUT is supported.
I refactored the initial solution and updated all initially supported elements |
Custom elements will be able to take control over validation by defining rendering methods on a DOM element