@vaadin/field-base 23.3.17 → 23.3.19

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/field-base",
3
- "version": "23.3.17",
3
+ "version": "23.3.19",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@open-wc/dedupe-mixin": "^1.3.0",
34
34
  "@polymer/polymer": "^3.0.0",
35
- "@vaadin/component-base": "~23.3.17",
35
+ "@vaadin/component-base": "~23.3.19",
36
36
  "lit": "^2.0.0"
37
37
  },
38
38
  "devDependencies": {
@@ -40,5 +40,5 @@
40
40
  "@vaadin/testing-helpers": "^0.3.2",
41
41
  "sinon": "^13.0.2"
42
42
  },
43
- "gitHead": "4e497e613e5e30ebe8fb504ec7cc4fcbfdd7d76a"
43
+ "gitHead": "2ef4452124034616fb9f7e99fa3c381a600986ba"
44
44
  }
@@ -4,6 +4,7 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { timeOut } from '@vaadin/component-base/src/async.js';
7
+ import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
7
8
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
8
9
  import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
9
10
  import { DelegateFocusMixin } from './delegate-focus-mixin.js';
@@ -139,6 +140,7 @@ export const InputControlMixin = (superclass) =>
139
140
 
140
141
  if (this.clearElement) {
141
142
  this.clearElement.addEventListener('click', (e) => this._onClearButtonClick(e));
143
+ this.clearElement.addEventListener('mousedown', (e) => this._onClearButtonMouseDown(e));
142
144
  }
143
145
  }
144
146
 
@@ -148,10 +150,20 @@ export const InputControlMixin = (superclass) =>
148
150
  */
149
151
  _onClearButtonClick(event) {
150
152
  event.preventDefault();
151
- this.inputElement.focus();
152
153
  this.__clear();
153
154
  }
154
155
 
156
+ /**
157
+ * @param {Event} event
158
+ * @protected
159
+ */
160
+ _onClearButtonMouseDown(event) {
161
+ event.preventDefault();
162
+ if (!isTouch) {
163
+ this.inputElement.focus();
164
+ }
165
+ }
166
+
155
167
  /**
156
168
  * Override an event listener from `DelegateFocusMixin`.
157
169
  * @param {FocusEvent} event