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:
parent
d5cad9ad3f
commit
fc925827b2
@ -874,7 +874,10 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||||||
const data = this.data;
|
const data = this.data;
|
||||||
const id = data.id;
|
const id = data.id;
|
||||||
const value = storage.getOrCreateValue(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;
|
}).value;
|
||||||
|
|
||||||
this.container.className = "buttonWidgetAnnotation checkBox";
|
this.container.className = "buttonWidgetAnnotation checkBox";
|
||||||
|
1
test/pdfs/issue12716.pdf.link
Normal file
1
test/pdfs/issue12716.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/mozilla/pdf.js/files/5670936/form-cms1500.pdf
|
@ -5038,5 +5038,15 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq",
|
"type": "eq",
|
||||||
"forms": true
|
"forms": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue12716",
|
||||||
|
"file": "pdfs/issue12716.pdf",
|
||||||
|
"md5": "9bdc9c552bcfccd629f5f97385e79ca5",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"type": "eq",
|
||||||
|
"forms": true,
|
||||||
|
"lastPage": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user