Skip to content

Commit

Permalink
Missed some places in the last update to ignore mouse when editing text
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrossman committed Sep 16, 2015
1 parent 57c15a3 commit 0b18be5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,11 @@
},

updateFormInputs: function() {

//ignore mouse movements while an above-calendar text input has focus
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
return;

this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format));
if (this.endDate)
this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format));
Expand All @@ -984,6 +989,7 @@
} else {
this.container.find('button.applyBtn').attr('disabled', 'disabled');
}

},

move: function() {
Expand Down Expand Up @@ -1125,6 +1131,11 @@
},

hoverRange: function(e) {

//ignore mouse movements while an above-calendar text input has focus
if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
return;

var label = e.target.innerHTML;
if (label == this.locale.customRangeLabel) {
this.updateView();
Expand All @@ -1133,6 +1144,7 @@
this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format));
this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format));
}

},

clickRange: function(e) {
Expand Down Expand Up @@ -1476,4 +1488,4 @@
return this;
};

}));
}));

0 comments on commit 0b18be5

Please sign in to comment.