Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit bb04bfa

Browse files
crisbetoThomasBurleson
authored andcommitted
fix(datepicker): simplify the handleBodyClick handler
The `handleBodyClick` handler was checking whether the click occurred either in a `md-calendar-month` or a `md-calendar-year` element. It's simpler to check if it was in a `md-calendar`. Fixes #8452. Closes #8804
1 parent 37905c0 commit bb04bfa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/components/datepicker/js/datepickerDirective.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// TODO(jelbourn): something better for mobile (calendar panel takes up entire screen?)
1010
// TODO(jelbourn): input behavior (masking? auto-complete?)
1111
// TODO(jelbourn): UTC mode
12-
// TODO(jelbourn): RTL
1312

1413

1514
angular.module('material.components.datepicker')
@@ -717,9 +716,7 @@
717716
*/
718717
DatePickerCtrl.prototype.handleBodyClick = function(event) {
719718
if (this.isCalendarOpen) {
720-
// TODO(jelbourn): way want to also include the md-datepicker itself in this check.
721-
var closest = this.$mdUtil.getClosest;
722-
var isInCalendar = closest(event.target, 'md-calendar-year') || closest(event.target, 'md-calendar-month');
719+
var isInCalendar = this.$mdUtil.getClosest(event.target, 'md-calendar');
723720

724721
if (!isInCalendar) {
725722
this.closeCalendarPane();

0 commit comments

Comments
 (0)