title: Prevent mat-datepicker from closing on date selection
body: <p>I have a requirement that user can select multiple dates in datepicker, but after each date selection the mat-datepicker closes, I want to prevent mat-datepicker from closing on date selection and close the datepicker when we click outside the datepicker or on calendar icon.</p>
  
  <p><a href="https://i.stack.imgur.com/IUxek.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IUxek.png" alt="datepicker"></a></p>
  
  <p>I tried <code>closed</code> event on mat-datepicker but the date-picker is flickering on each date selection plus it is doesn't close when we click outside the datepicker.</p>
  
  <p>Here's what I tried:</p>
  
  <p>html code:</p>
  
  <pre><code>&lt;input formControlName="fromDate" matInput [matDatepicker]="fromDatePicker" placeholder="From Date" [min]="minDate" readonly&gt;
  &lt;mat-datepicker-toggle matSuffix [for]="fromDatePicker"&gt;&lt;/mat-datepicker-toggle&gt;
  &lt;mat-datepicker #fromDatePicker (closed)="_openCalendar(fromDatePicker)"&gt;&lt;/mat-datepicker&gt;
  </code></pre>
  
  <p>typescript code:</p>
  
  <pre><code>_openCalendar(picker: MatDatepicker&lt;Date&gt;) {
      picker.open();
  }
  </code></pre>