InfomediaLtd / angular2-materialize

Angular 2 support for Materialize CSS framework.
https://infomedialtd.github.io/angular2-materialize/
MIT License
407 stars 140 forks source link

Datepicker re-opening #353

Closed jasperSpeicher closed 7 years ago

jasperSpeicher commented 7 years ago

In Chrome on mac: When I open the picker modal, then close it, then switch out of chrome, and then switch back, the datepicker has re-opened.

Happens in this sample app as well as in my own. https://infomedialtd.github.io/angular2-materialize/#/DatePicker

rubyboy commented 7 years ago

Thanks for reporting this issue. Unfortunately, it's a bug in the original library, as suggested here: https://github.com/Dogfalo/materialize/issues/4700

Here's the original bug with a suggested workaround: https://github.com/amsul/pickadate.js/issues/160

I'll close the issue, for now, to keep it consistent with the MaterlializeCSS library.

samber commented 6 years ago

These few lines worked for me:

  private datePickerOptions = {
    onClose: () => {
      $(":focus").blur();
    },
  };
<input type="text"materialize="pickadate" [materializeParams]="[datePickerOptions]" />