Skip to content

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

Closed
@doctorhilarius

Description

@doctorhilarius

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 { }
}

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions