components icon indicating copy to clipboard operation
components copied to clipboard

launch datepicker in a dialog and click outside dialog will result in a small square on the screen

Open wpcfan opened this issue 9 years ago • 5 comments

Bug, feature request, or proposal:

bug

What is the expected behavior?

datepicker should get dismissed and the dialog should keep open unless I click outside again.

What is the current behavior?

both datepicker and dialog are gone, but remain a small square on the screen

What are the steps to reproduce?

  1. in a dialog (contains a form)
    <md-input-container class="full-width">
      <input mdInput 
        [mdDatepicker]="dueDatePicker" 
        placeholder="pick a due date" 
        formControlName="dueDate">
      <button mdSuffix [mdDatepickerToggle]="dueDatePicker"></button>
    </md-input-container>
    <md-datepicker touchUi="true" #dueDatePicker></md-datepicker>
  1. launch the dialog, and then launch date picker
  2. click outside dialog and datepicker
  3. you will see a small square on the screen

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 4, Material beta5, macOS 10.12.4, Chrome: 57.0.2987.133 (64-bit)

Is there anything else we should know?

wpcfan avatar May 17 '17 16:05 wpcfan

Can you repro in a plunker?

For our app, clicking outside the datepicker just closes the datepicker, not the dialog.

willshowell avatar May 17 '17 21:05 willshowell

I also get the small square. In my case it's because I navigate to another component when a selection is made and I guess the calendar has not completed its exit animation. It sort of works if I wrap the navigate in a setTimeout(..,0). I say "sort of" because you still see the small square for a short while before it disappears,

https://plnkr.co/edit/uGdquTlfAJxs3C5yCEPp

pietie avatar May 18 '17 06:05 pietie

Looks like this has been fixed in master (here's a version of @pietie's plunker with updated systemjs.config.js: https://plnkr.co/edit/oKF71oguDhHtOWQL6eGS?p=preview)

mmalerba avatar Jul 28 '17 23:07 mmalerba

Opening the issue again.

Touch UI is or have become bugged again for mat datepicker, so you need to use "setTimeout(() => this.router.navigate(['/home']), 0);" for it to close correctly when a navigation happen while it is open, so you don't get the small box that block all input.

MortenDals avatar Sep 14 '18 11:09 MortenDals

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.