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

Date Picker doesn't display error messages #224

Closed
cecilia-sanare opened this issue Aug 28, 2016 · 4 comments
Closed

Date Picker doesn't display error messages #224

cecilia-sanare opened this issue Aug 28, 2016 · 4 comments
Milestone

Comments

@cecilia-sanare
Copy link
Contributor

cecilia-sanare commented Aug 28, 2016

Seeing how vaadin-combo-box and the paper components generally allow for an error-message I would expect the date-picker to be the same.

<vaadin-date-picker required error-message="Some error message"></vaadin-date-picker>
@jouni
Copy link
Member

jouni commented Aug 29, 2016

@tomivirkki, what would it mean to add this? It would probably need some documentation from our side as well, right?

@cecilia-sanare
Copy link
Contributor Author

cecilia-sanare commented Aug 29, 2016

@jouni I ended up playing around with it and adding the error-message itself is relatively easy.

Just a matter of adding a new property and adding:

<template is="dom-if" if="[[errorMessage]]">
  <paper-input-error aria-live="assertive">[[errorMessage]]</paper-input-error>
</template>

Overall the change is fairly simple, however a secondary issue is that the date-picker becomes invalid fairly easily.

Example

Live Demo

  • Click on the input field
  • The date picker should pop up and the input will become invalid

Steps to Reproduce

  1. Add vaadin-date-picker
  2. Add auto-validate and required to the element

@tomivirkki
Copy link
Member

@nick-woodward and @jouni The errorMessage property might be a reasonable addition to the vaadin-date-picker API, especially since it should work nicely inside iron-form.

Note that you can already add any custom content inside the date picker by using vaadin-date-picker-light like in the following example:
https://jsfiddle.net/xhfbu5ny/

@cecilia-sanare
Copy link
Contributor Author

@tomivirkki Awesome, I was unaware the light version was so flexible.

Not overly surprising, but it looks like the light version has the same issue as the regular version regarding validation.

However, it looks like the validation issue is somewhat documented in the code as a TODO comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants