Datepicker Pop-up Doesn't Close when Overlay Background is Clicked
See original GitHub issueBug, 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:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This demos the issue: https://plnkr.co/edit/nDws65ii76v9xHDQKURU?p=preview
It shows up whenever the parent component uses
OnPush
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.