mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
[Annotations] charLimit === 0 means unlimited (bug 1782564)
Changing the charLimit in JS had no impact, so this patch aims to fix that and add an integration test for it.
This commit is contained in:
parent
b05010c3eb
commit
c06c5f7cbd
8 changed files with 122 additions and 12 deletions
|
@ -2255,7 +2255,7 @@ class TextWidgetAnnotation extends WidgetAnnotation {
|
|||
// Determine the maximum length of text in the field.
|
||||
let maximumLength = getInheritableProperty({ dict, key: "MaxLen" });
|
||||
if (!Number.isInteger(maximumLength) || maximumLength < 0) {
|
||||
maximumLength = null;
|
||||
maximumLength = 0;
|
||||
}
|
||||
this.data.maxLen = maximumLength;
|
||||
|
||||
|
@ -2266,7 +2266,7 @@ class TextWidgetAnnotation extends WidgetAnnotation {
|
|||
!this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) &&
|
||||
!this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) &&
|
||||
!this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) &&
|
||||
this.data.maxLen !== null;
|
||||
this.data.maxLen !== 0;
|
||||
this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue