Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-datepicker ignoring required attribute on pristine input #8411

Closed
astynax777 opened this issue May 11, 2016 · 2 comments
Closed

md-datepicker ignoring required attribute on pristine input #8411

astynax777 opened this issue May 11, 2016 · 2 comments
Assignees
Labels
has: Pull Request A PR has been created to address this issue

Comments

@astynax777
Copy link

Codepen is here: http://codepen.io/astynax777/pen/ONqQOY

You'll notice that if you submit the form without first selecting and clearing a date, the validation does not fire on the md-datepicker.

I would like to know a workaround for this in the meantime.

AngularJS stack: 1.5.5
Material: 1.1.0-rc4

@astynax777 astynax777 changed the title md-datepicker ignoring required attribute on pristine form md-datepicker ignoring required attribute on pristine input May 11, 2016
@astynax777
Copy link
Author

astynax777 commented May 11, 2016

Just saw this in the source:
// TODO(jelbourn): forward more attributes to the internal input (required, autofocus, etc.)
Looks like it hasn't been implemented yet but will be when @jelbourn gets around to it.

I wonder though, was it ever working? I tested it in 1.0.7 and saw it didn't work there. The documentation states it supports required and ng-required:

mdDatepicker API Documentation

<md-datepicker> is a component used to select a single date. For information on how to configure internationalization for the date picker, see $mdDateLocaleProvider.

This component supports ngMessages. Supported attributes are:

  • required: whether a required date is not set.
  • mindate: whether the selected date is before the minimum allowed date.
  • maxdate: whether the selected date is after the maximum allowed date.

@dohomi
Copy link

dohomi commented May 16, 2016

I just have seen this with md-select as well.

http://codepen.io/anon/pen/jqoEOG

Would be great to see a fix for this. On regular input it works as expected.

@ThomasBurleson ThomasBurleson modified the milestone: Deprecated May 26, 2016
@topherfangio topherfangio modified the milestones: - Backlog, Deprecated May 26, 2016
@crisbeto crisbeto self-assigned this Jun 26, 2016
@crisbeto crisbeto added the has: Pull Request A PR has been created to address this issue label Jul 16, 2016
crisbeto added a commit to crisbeto/material that referenced this issue Jul 16, 2016
Fixes invalid datepickers not being highlighted when their parent form is submitted.

Fixes angular#8411.
crisbeto added a commit to crisbeto/material that referenced this issue Jul 16, 2016
Fixes invalid datepickers not being highlighted when their parent form is submitted.

Fixes angular#8411.
crisbeto added a commit to crisbeto/material that referenced this issue Jul 16, 2016
* Fixes invalid datepickers not being highlighted when their parent form is submitted.
* Fixes $mdAria not being imported and causing a JS error occasionally.

Fixes angular#8411.
@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue
Projects
None yet
Development

No branches or pull requests

6 participants