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 35c90984.
This commit is contained in:
parent
2a93ade197
commit
f1f8ee47ff
@ -2494,7 +2494,7 @@ class PopupElement {
|
|||||||
renderRichText(
|
renderRichText(
|
||||||
{
|
{
|
||||||
html: this.#html || this.#contentsObj.str,
|
html: this.#html || this.#contentsObj.str,
|
||||||
dir: this.#contentsObj.dir,
|
dir: this.#contentsObj?.dir,
|
||||||
className: "popupContent",
|
className: "popupContent",
|
||||||
},
|
},
|
||||||
popup
|
popup
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user