question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker Pop-up Doesn't Close when Overlay Background is Clicked

See original GitHub issue

Bug, feature request, or proposal:

When using the touchUi feature of the datepicker, the overlay should close when the overlay background is clicked.

What is the current behavior?

Clicking outside the overlay removes the background but does not close the overlay. After the background is removed, clicking any button on the overlay closes the overlay instead of performing the button’s action.

What is the expected behavior?

Clicking outside the overlay should close the overlay. The overlay should not close unless a date is selected or someone clicks outside the overlay.

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

Improve usability

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

Angular: 4.2.0 Material: 2.0.0-beta.6

Is there anything else we should know?

Adding the click listener to the Component’s host property provides the correct behavior, even though no action is actually taken when the event occurs:

@Component({
   ...
   host: {
        '(document:click)': 'onClick()',
    }
})
export class MyComponent {
   ...
   private onClick(): void { }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
willshowellcommented, Jun 14, 2017

This demos the issue: https://plnkr.co/edit/nDws65ii76v9xHDQKURU?p=preview

It shows up whenever the parent component uses OnPush

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular material datepicker doesn't open in modal dialog
I have an angular material 2 date-picker ...
Read more >
Datepicker | Angular Material
Gets the ID of an element that should be used a description for the calendar overlay. Gets the value at which the calendar...
Read more >
DatePicker - Android Developers
Returns whether this View should use a default focus highlight when it gets focused but doesn't have R.attr.state_focused defined in its background.
Read more >
Dialog / How To / Close Dialog when click outside of its region
In the following sample, dialog is closed when clicking outside the dialog area using hide method.
Read more >
Element: <oj-popup> - Oracle
Close the open popup if the modality is modal. ... For cases where the popup doesn't steal focus when it's open, a content...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found