Skip to content

Commit 7bccb7f

Browse files
paodbmlopezFC
authored andcommitted
fix: fix enter and tab keys behavior
1 parent 6f7add0 commit 7bccb7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vcf-date-range-picker-mixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ export const DateRangePickerMixin = (subclass) =>
11511151

11521152
break;
11531153
case 'enter': {
1154-
if (this.shadowRoot.activeElement === this._inputEndElement) this._selectingStartDate=false;
1154+
if (this.shadowRoot.activeElement === this._inputEndElement.inputElement) this._selectingStartDate=false;
11551155
if (this._selectingStartDate) {
11561156
const parsedStartDate = this._getParsedDate(this._inputStartValue);
11571157
const isValidStartDate = this._isValidDate(parsedStartDate);
@@ -1216,7 +1216,7 @@ export const DateRangePickerMixin = (subclass) =>
12161216
}
12171217
break;
12181218
case 'tab':
1219-
if (this.shadowRoot.activeElement === this._inputStartElement)
1219+
if (this.shadowRoot.activeElement === this._inputStartElement.inputElement)
12201220
{
12211221
if (e.shiftKey) {
12221222
this.close();
@@ -1230,7 +1230,7 @@ export const DateRangePickerMixin = (subclass) =>
12301230
this._selectingStartDate=false;
12311231
this._inputEndElement.focus();
12321232
}
1233-
} else if (this.shadowRoot.activeElement === this._inputEndElement) {
1233+
} else if (this.shadowRoot.activeElement === this._inputEndElement.inputElement) {
12341234
if (e.shiftKey) {
12351235
const endParsedDate = this._getParsedDate(this._inputEndValue);
12361236
if (this._isValidDate(endParsedDate)) {

0 commit comments

Comments
 (0)