@vaadin/field-base 23.3.0-beta2 → 23.3.0
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 +3 -3
- package/src/input-mixin.d.ts +2 -0
- package/src/input-mixin.js +15 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-base",
|
|
3
|
-
"version": "23.3.0
|
|
3
|
+
"version": "23.3.0",
|
|
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.0
|
|
35
|
+
"@vaadin/component-base": "~23.3.0",
|
|
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": "
|
|
43
|
+
"gitHead": "41eff1d019abb6d1ae23e3d657ebc1a2308d36d6"
|
|
44
44
|
}
|
package/src/input-mixin.d.ts
CHANGED
package/src/input-mixin.js
CHANGED
|
@@ -155,11 +155,7 @@ export const InputMixin = dedupingMixin(
|
|
|
155
155
|
* @private
|
|
156
156
|
*/
|
|
157
157
|
__onInput(event) {
|
|
158
|
-
|
|
159
|
-
// the actual native input element, on which the event occurred,
|
|
160
|
-
// can be inside shadow trees.
|
|
161
|
-
const target = event.composedPath()[0];
|
|
162
|
-
this._hasInputValue = target.value.length > 0;
|
|
158
|
+
this._setHasInputValue(event);
|
|
163
159
|
this._onInput(event);
|
|
164
160
|
}
|
|
165
161
|
|
|
@@ -230,5 +226,19 @@ export const InputMixin = dedupingMixin(
|
|
|
230
226
|
get _hasValue() {
|
|
231
227
|
return this.value != null && this.value !== '';
|
|
232
228
|
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Sets the `_hasInputValue` property based on the `input` event.
|
|
232
|
+
*
|
|
233
|
+
* @param {InputEvent} event
|
|
234
|
+
* @protected
|
|
235
|
+
*/
|
|
236
|
+
_setHasInputValue(event) {
|
|
237
|
+
// In the case a custom web component is passed as `inputElement`,
|
|
238
|
+
// the actual native input element, on which the event occurred,
|
|
239
|
+
// can be inside shadow trees.
|
|
240
|
+
const target = event.composedPath()[0];
|
|
241
|
+
this._hasInputValue = target.value.length > 0;
|
|
242
|
+
}
|
|
233
243
|
},
|
|
234
244
|
);
|