Checkboxes with the same name must behave like a radio buttons group
* aims to fix issue #12706
This commit is contained in:
parent
b194c820bf
commit
1fcffe8034
@ -717,6 +717,16 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
|
||||
}
|
||||
|
||||
element.addEventListener("change", function (event) {
|
||||
const name = event.target.name;
|
||||
for (const checkbox of document.getElementsByName(name)) {
|
||||
if (checkbox !== event.target) {
|
||||
checkbox.checked = false;
|
||||
storage.setValue(
|
||||
checkbox.parentNode.getAttribute("data-annotation-id"),
|
||||
{ value: false }
|
||||
);
|
||||
}
|
||||
}
|
||||
storage.setValue(id, { value: event.target.checked });
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user