Use the V entry as an option when no options in a choice widget
It fixes #19083. It isn't really a fix but more a workaround (we should correctly implement the choice widget as a mix of text input+select).
This commit is contained in:
parent
07765e993e
commit
b0b0de98e7
@ -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.
|
// Process field flags for the display layer.
|
||||||
this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);
|
this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);
|
||||||
this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);
|
this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);
|
||||||
|
|||||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -681,3 +681,4 @@
|
|||||||
!issue18894.pdf
|
!issue18894.pdf
|
||||||
!bug1922766.pdf
|
!bug1922766.pdf
|
||||||
!issue18956.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,
|
"rounds": 1,
|
||||||
"type": "eq",
|
"type": "eq",
|
||||||
"link": true
|
"link": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue19083",
|
||||||
|
"file": "pdfs/issue19083.pdf",
|
||||||
|
"md5": "2e2aa6c1904c1e6a89a5a6ec95d5ce7e",
|
||||||
|
"rounds": 1,
|
||||||
|
"forms": true,
|
||||||
|
"talos": false,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user