Skip to content

Commit f1f8ee4

Browse files
committed
Fix the rendering of XFA rich text in popup annotations
Before the introduction of the `renderRichText` helper function we exclusively used `this.#html` for XFA rich text and exclusively used `this.#contentsObj` for plain text. However, after the refactoring we tried to access `this.#contentsObj.dir` in both cases, which fails for XFA rich text because `this.#contentsObj` is `null` in that case. This commit fixes the issue by using optional chaining to make sure we don't try to access non-existent `this.#contentsObj` properties, which makes the `must update an existing annotation and show the right popup` freetext integration pass again. Fixes #20237. Fixes 35c9098.
1 parent 2a93ade commit f1f8ee4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/display/annotation_layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ class PopupElement {
24942494
renderRichText(
24952495
{
24962496
html: this.#html || this.#contentsObj.str,
2497-
dir: this.#contentsObj.dir,
2497+
dir: this.#contentsObj?.dir,
24982498
className: "popupContent",
24992499
},
25002500
popup

0 commit comments

Comments
 (0)