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";

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/5670936/form-cms1500.pdf

View File

@ -5038,5 +5038,15 @@
"rounds": 1,
"type": "eq",
"forms": true
},
{
"id": "issue12716",
"file": "pdfs/issue12716.pdf",
"md5": "9bdc9c552bcfccd629f5f97385e79ca5",
"rounds": 1,
"link": true,
"type": "eq",
"forms": true,
"lastPage": 1
}
]