mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #19086 from calixteman/issue19083
Use the V entry as an option when no options in a choice widget
This commit is contained in:
commit
5b600e8f84
4 changed files with 22 additions and 0 deletions
|
@ -3511,6 +3511,18 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation {
|
|||
}
|
||||
}
|
||||
|
||||
// It's a workaround for the issue #19083.
|
||||
// Normally a choice widget is a mix of a text field and a listbox,
|
||||
// So in the case where the V entry isn't an option we should just set it
|
||||
// as the text field value.
|
||||
if (this.data.options.length === 0 && this.data.fieldValue.length > 0) {
|
||||
// If there are no options, then the field value is the only option.
|
||||
this.data.options = this.data.fieldValue.map(value => ({
|
||||
exportValue: value,
|
||||
displayValue: value,
|
||||
}));
|
||||
}
|
||||
|
||||
// Process field flags for the display layer.
|
||||
this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);
|
||||
this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -681,3 +681,4 @@
|
|||
!issue18894.pdf
|
||||
!bug1922766.pdf
|
||||
!issue18956.pdf
|
||||
!issue19083.pdf
|
||||
|
|
BIN
test/pdfs/issue19083.pdf
Executable file
BIN
test/pdfs/issue19083.pdf
Executable file
Binary file not shown.
|
@ -10766,5 +10766,14 @@
|
|||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"link": true
|
||||
},
|
||||
{
|
||||
"id": "issue19083",
|
||||
"file": "pdfs/issue19083.pdf",
|
||||
"md5": "2e2aa6c1904c1e6a89a5a6ec95d5ce7e",
|
||||
"rounds": 1,
|
||||
"forms": true,
|
||||
"talos": false,
|
||||
"type": "eq"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue