@vaadin/vaadin-checkbox
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-checkbox", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"main": "vaadin-checkbox.js", | ||
@@ -16,0 +16,0 @@ "author": "Vaadin Ltd", |
@@ -109,3 +109,3 @@ /** | ||
static get version() { | ||
return '2.2.2'; | ||
return '2.2.3'; | ||
} | ||
@@ -192,3 +192,4 @@ | ||
const label = this.shadowRoot.querySelector('[part~="label"]'); | ||
if (label.firstElementChild.assignedNodes().length === 0) { | ||
const assignedNodes = label.firstElementChild.assignedNodes(); | ||
if (this._isAssignedNodesEmpty(assignedNodes)) { | ||
label.setAttribute('empty', ''); | ||
@@ -200,2 +201,10 @@ } else { | ||
_isAssignedNodesEmpty(nodes) { | ||
// The assigned nodes considered to be empty if there is no slotted content or only one empty text node | ||
return nodes.length === 0 || | ||
(nodes.length == 1 | ||
&& nodes[0].nodeType == Node.TEXT_NODE | ||
&& nodes[0].textContent.trim() === ''); | ||
} | ||
_checkedChanged(checked) { | ||
@@ -202,0 +211,0 @@ if (this.indeterminate) { |
44510
873