@vaadin/form-layout 23.0.6 → 23.0.9

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/form-layout",
3
- "version": "23.0.6",
3
+ "version": "23.0.9",
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.6",
38
- "@vaadin/vaadin-lumo-styles": "^23.0.6",
39
- "@vaadin/vaadin-material-styles": "^23.0.6",
40
- "@vaadin/vaadin-themable-mixin": "^23.0.6"
37
+ "@vaadin/component-base": "^23.0.9",
38
+ "@vaadin/vaadin-lumo-styles": "^23.0.9",
39
+ "@vaadin/vaadin-material-styles": "^23.0.9",
40
+ "@vaadin/vaadin-themable-mixin": "^23.0.9"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@esm-bundle/chai": "^4.3.4",
44
- "@vaadin/custom-field": "^23.0.6",
44
+ "@vaadin/custom-field": "^23.0.9",
45
45
  "@vaadin/testing-helpers": "^0.3.2",
46
- "@vaadin/text-field": "^23.0.6",
46
+ "@vaadin/text-field": "^23.0.9",
47
47
  "sinon": "^9.2.1"
48
48
  },
49
- "gitHead": "82ca8522e24a63343fb28bcb4c686e55d25c8858"
49
+ "gitHead": "4d687bdd48ba78d55f3371a78b70818e4dfca1a3"
50
50
  }
@@ -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
- this.__labelNode.id = this.__labelId;
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);