@vaadin/date-picker 22.0.1 → 22.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/date-picker",
3
- "version": "22.0.1",
3
+ "version": "22.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,21 +35,21 @@
35
35
  "@polymer/iron-a11y-announcer": "^3.0.0",
36
36
  "@polymer/iron-media-query": "^3.0.0",
37
37
  "@polymer/polymer": "^3.2.0",
38
- "@vaadin/button": "^22.0.1",
39
- "@vaadin/component-base": "^22.0.1",
40
- "@vaadin/field-base": "^22.0.1",
41
- "@vaadin/input-container": "^22.0.1",
42
- "@vaadin/vaadin-lumo-styles": "^22.0.1",
43
- "@vaadin/vaadin-material-styles": "^22.0.1",
44
- "@vaadin/vaadin-overlay": "^22.0.1",
45
- "@vaadin/vaadin-themable-mixin": "^22.0.1"
38
+ "@vaadin/button": "^22.0.2",
39
+ "@vaadin/component-base": "^22.0.2",
40
+ "@vaadin/field-base": "^22.0.2",
41
+ "@vaadin/input-container": "^22.0.2",
42
+ "@vaadin/vaadin-lumo-styles": "^22.0.2",
43
+ "@vaadin/vaadin-material-styles": "^22.0.2",
44
+ "@vaadin/vaadin-overlay": "^22.0.2",
45
+ "@vaadin/vaadin-themable-mixin": "^22.0.2"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@esm-bundle/chai": "^4.3.4",
49
- "@vaadin/dialog": "^22.0.1",
50
- "@vaadin/polymer-legacy-adapter": "^22.0.1",
49
+ "@vaadin/dialog": "^22.0.2",
50
+ "@vaadin/polymer-legacy-adapter": "^22.0.2",
51
51
  "@vaadin/testing-helpers": "^0.3.2",
52
52
  "sinon": "^9.2.0"
53
53
  },
54
- "gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
54
+ "gitHead": "df21370c4a655a38eac11f79686021ab3b0887ad"
55
55
  }
@@ -3,7 +3,6 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { addListener } from '@polymer/polymer/lib/utils/gestures.js';
7
6
  import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
8
7
  import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
9
8
  import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
@@ -302,7 +301,7 @@ export const DatePickerMixin = (subclass) =>
302
301
  /** @private */
303
302
  _noInput: {
304
303
  type: Boolean,
305
- computed: '_isNoInput(inputElement, _fullscreen, _ios, i18n, i18n.*)'
304
+ computed: '_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)'
306
305
  },
307
306
 
308
307
  /** @private */
@@ -415,17 +414,11 @@ export const DatePickerMixin = (subclass) =>
415
414
  ready() {
416
415
  super.ready();
417
416
 
418
- addListener(this, 'tap', (e) => {
417
+ this.addEventListener('click', (e) => {
419
418
  if (!this._isClearButton(e) && (!this.autoOpenDisabled || this._noInput)) {
420
419
  this.open();
421
420
  }
422
421
  });
423
-
424
- this.addEventListener('touchend', (e) => {
425
- if (!this._isClearButton(e)) {
426
- e.preventDefault();
427
- }
428
- });
429
422
  }
430
423
 
431
424
  /** @protected */
@@ -541,8 +534,17 @@ export const DatePickerMixin = (subclass) =>
541
534
  }
542
535
 
543
536
  /** @private */
544
- _isNoInput(inputElement, fullscreen, ios, i18n) {
545
- return !inputElement || fullscreen || ios || !i18n.parseDate;
537
+ // eslint-disable-next-line max-params
538
+ _isNoInput(inputElement, fullscreen, ios, i18n, opened, autoOpenDisabled) {
539
+ // On fullscreen mode, text input is disabled if auto-open isn't disabled or
540
+ // whenever the dropdown is opened
541
+ const noInputOnFullscreenMode = fullscreen && (!autoOpenDisabled || opened);
542
+ // On iOS, text input is disabled whenever the dropdown is opened, because
543
+ // the virtual keyboard doesn't affect the viewport metrics and thus the
544
+ // dropdown could get covered by the keyboard.
545
+ const noInputOnIos = ios && opened;
546
+
547
+ return !inputElement || noInputOnFullscreenMode || noInputOnIos || !i18n.parseDate;
546
548
  }
547
549
 
548
550
  /** @private */