happy-dom 2.33.0 → 2.33.1
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.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
@@ -64,7 +64,16 @@ var HTMLLabelElement = /** @class */ (function (_super) {
|
|
64
64
|
*/
|
65
65
|
get: function () {
|
66
66
|
var htmlFor = this.htmlFor;
|
67
|
-
|
67
|
+
if (htmlFor) {
|
68
|
+
return this.ownerDocument.getElementById(htmlFor);
|
69
|
+
}
|
70
|
+
for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
|
71
|
+
var child = _a[_i];
|
72
|
+
if (child.tagName === 'INPUT') {
|
73
|
+
return child;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
return null;
|
68
77
|
},
|
69
78
|
enumerable: false,
|
70
79
|
configurable: true
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HTMLLabelElement.js","sourceRoot":"","sources":["../../../src/nodes/html-label-element/HTMLLabelElement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAAsD;AAKtD;;;;;GAKG;AACH;IAA8C,oCAAW;IAAzD;QAAA,
|
1
|
+
{"version":3,"file":"HTMLLabelElement.js","sourceRoot":"","sources":["../../../src/nodes/html-label-element/HTMLLabelElement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAAsD;AAKtD;;;;;GAKG;AACH;IAA8C,oCAAW;IAAzD;QAAA,qEAoEC;QAnEO,cAAQ,GAAW,IAAI,CAAC;;IAmEhC,CAAC;IA5DA,sBAAW,qCAAO;QALlB;;;;WAIG;aACH;YACC,IAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACjD,IAAI,OAAO,KAAK,IAAI,EAAE;gBACrB,OAAO,OAAO,CAAC;aACf;YACD,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,C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
|
4
4
|
"license": "MIT",
|
5
5
|
"homepage": "https://github.com/capricorn86/happy-dom",
|
6
6
|
"repository": "https://github.com/capricorn86/happy-dom",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"ts-jest": "^26.5.6",
|
75
75
|
"typescript": "^4.2.4"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "2b6530d8c6fa5611d669d33a0b3632048a846fb9"
|
78
78
|
}
|
@@ -41,7 +41,15 @@ export default class HTMLLabelElement extends HTMLElement implements IHTMLLabelE
|
|
41
41
|
*/
|
42
42
|
public get control(): IHTMLElement {
|
43
43
|
const htmlFor = this.htmlFor;
|
44
|
-
|
44
|
+
if (htmlFor) {
|
45
|
+
return <IHTMLElement>this.ownerDocument.getElementById(htmlFor);
|
46
|
+
}
|
47
|
+
for (const child of this.children) {
|
48
|
+
if (child.tagName === 'INPUT') {
|
49
|
+
return <IHTMLElement>child;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
return null;
|
45
53
|
}
|
46
54
|
|
47
55
|
/**
|