Skip to content

Commit 2ba8066

Browse files
committed
CheckboxLabel: Match the LAST label of the Form Block
EN checkboxes have two labels, and we want to change the last one
1 parent f2e2bca commit 2ba8066

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/scripts/dist/checkbox-label.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class CheckboxLabel {
1919
var _a;
2020
const labelText = (_a = checkboxLabel.textContent) === null || _a === void 0 ? void 0 : _a.trim();
2121
const checkboxContainer = checkboxLabel.nextElementSibling;
22-
const checkboxLabelElement = checkboxContainer.querySelector("label");
22+
const checkboxLabelElement = checkboxContainer.querySelector("label:last-child");
2323
if (!checkboxLabelElement || !labelText)
2424
return;
2525
checkboxLabelElement.textContent = labelText;

packages/scripts/src/checkbox-label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class CheckboxLabel {
2727
const checkboxContainer =
2828
checkboxLabel.nextElementSibling as HTMLDivElement;
2929
const checkboxLabelElement = checkboxContainer.querySelector(
30-
"label"
30+
"label:last-child"
3131
) as HTMLLabelElement;
3232
if (!checkboxLabelElement || !labelText) return;
3333
checkboxLabelElement.textContent = labelText;

0 commit comments

Comments
 (0)