1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

fix initial state of checkboxes in display layer (#12904)

consider the export value when multiple checkboxes have the same name
This commit is contained in:
dhufnagel 2021-02-12 11:22:54 +01:00 committed by GitHub
parent d5cad9ad3f
commit fc925827b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -874,7 +874,10 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
const data = this.data;
const id = data.id;
const value = storage.getOrCreateValue(id, {
value: data.fieldValue && data.fieldValue !== "Off",
value:
data.fieldValue &&
((data.exportValue && data.exportValue === data.fieldValue) ||
(!data.exportValue && data.fieldValue !== "Off")),
}).value;
this.container.className = "buttonWidgetAnnotation checkBox";