h2qutc / angular-material-components

Angular Material Library provide extra components for every project
https://h2qutc.github.io/angular-material-components/
MIT License
331 stars 162 forks source link

Picker doesn't highlight selected date when using without `mat-datepicker-toggle` #66

Open WLun001 opened 4 years ago

WLun001 commented 4 years ago
 <label class="mp-form-label" for="end-time">End Date Time</label>
          <input (click)="endDatetimePicker.open()"
                 [ngxMatDatetimePicker]="endDatetimePicker"
                 formControlName="endDateTime"
                 id="end-time"
                 placeholder="End Date Time"
                 readonly>
          <ngx-mat-datetime-picker #endDatetimePicker
                                   [enableMeridian]="true">
          </ngx-mat-datetime-picker>

triggering picker without mat-datepicker-toggle will have problem. The picker value didn't get selected on picker

For example, my input has 6/30/2020, 2:31 PM value, but picker show the initial value i set from formControl, no matter how many time I select new date, it still select the initial value

image

Rigidoont commented 4 years ago

I experience the same issue. When opening datepicker by clicking on mat-datepicker-toggle, everything works fine. But as soon as datepicker is opened using #picker.open() method, selected date does not reflect on datepicker, although input's value is being changed properly.

Rigidoont commented 4 years ago

Workaround https://github.com/h2qutc/angular-material-components/issues/118#issuecomment-712812474