@vaadin/form-layout 23.0.5 → 23.0.8
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 +8 -8
- package/src/vaadin-form-item.js +10 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/form-layout",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "^23.0.
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
39
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
37
|
+
"@vaadin/component-base": "^23.0.8",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.8",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "^23.0.8",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
|
-
"@vaadin/custom-field": "^23.0.
|
|
44
|
+
"@vaadin/custom-field": "^23.0.8",
|
|
45
45
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
46
|
-
"@vaadin/text-field": "^23.0.
|
|
46
|
+
"@vaadin/text-field": "^23.0.8",
|
|
47
47
|
"sinon": "^9.2.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "43fe9d95c8cd745adc7bef214c0097c47f4f83ed"
|
|
50
50
|
}
|
package/src/vaadin-form-item.js
CHANGED
|
@@ -177,10 +177,6 @@ class FormItem extends ThemableMixin(PolymerElement) {
|
|
|
177
177
|
* @private
|
|
178
178
|
*/
|
|
179
179
|
this.__fieldNode = null;
|
|
180
|
-
|
|
181
|
-
// Ensure every instance has unique ID
|
|
182
|
-
const uniqueId = (FormItem._uniqueLabelId = 1 + FormItem._uniqueLabelId || 0);
|
|
183
|
-
this.__labelId = `label-${this.localName}-${uniqueId}`;
|
|
184
180
|
}
|
|
185
181
|
|
|
186
182
|
/**
|
|
@@ -244,7 +240,6 @@ class FormItem extends ThemableMixin(PolymerElement) {
|
|
|
244
240
|
*/
|
|
245
241
|
__onLabelSlotChange() {
|
|
246
242
|
if (this.__labelNode) {
|
|
247
|
-
this.__labelNode.id = '';
|
|
248
243
|
this.__labelNode = null;
|
|
249
244
|
|
|
250
245
|
if (this.__fieldNode) {
|
|
@@ -255,7 +250,16 @@ class FormItem extends ThemableMixin(PolymerElement) {
|
|
|
255
250
|
const newLabelNode = this.$.labelSlot.assignedElements()[0];
|
|
256
251
|
if (newLabelNode) {
|
|
257
252
|
this.__labelNode = newLabelNode;
|
|
258
|
-
|
|
253
|
+
|
|
254
|
+
if (this.__labelNode.id) {
|
|
255
|
+
// The new label node already has an id. Let's use it.
|
|
256
|
+
this.__labelId = this.__labelNode.id;
|
|
257
|
+
} else {
|
|
258
|
+
// The new label node doesn't have an id yet. Generate a unique one.
|
|
259
|
+
const uniqueId = (FormItem._uniqueLabelId = 1 + FormItem._uniqueLabelId || 0);
|
|
260
|
+
this.__labelId = `label-${this.localName}-${uniqueId}`;
|
|
261
|
+
this.__labelNode.id = this.__labelId;
|
|
262
|
+
}
|
|
259
263
|
|
|
260
264
|
if (this.__fieldNode) {
|
|
261
265
|
this.__linkLabelToField(this.__fieldNode);
|