Skip to content

Commit 1fcffe8

Browse files
committed
Checkboxes with the same name must behave like a radio buttons group
* aims to fix issue #12706
1 parent b194c82 commit 1fcffe8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/display/annotation_layer.js

+10
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,16 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
717717
}
718718

719719
element.addEventListener("change", function (event) {
720+
const name = event.target.name;
721+
for (const checkbox of document.getElementsByName(name)) {
722+
if (checkbox !== event.target) {
723+
checkbox.checked = false;
724+
storage.setValue(
725+
checkbox.parentNode.getAttribute("data-annotation-id"),
726+
{ value: false }
727+
);
728+
}
729+
}
720730
storage.setValue(id, { value: event.target.checked });
721731
});
722732

0 commit comments

Comments
 (0)