Skip to content

Commit

Permalink
Fix Richtext cannot show the file name in FileUpload
Browse files Browse the repository at this point in the history
Fixes: AFORM-3942
  • Loading branch information
hungoptimizely committed Jan 26, 2024
1 parent 10487c5 commit abe0e11
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormContainer, ParagraphText } from "@episerver/forms-sdk"
import { FormContainer, ParagraphText, getValueAsString } from "@episerver/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
Expand Down Expand Up @@ -42,7 +42,7 @@ export const ParagraphTextElementBlock = (props: ParagraphTextElementBlockProps)
const friendlyName = form.formElements.find(fe => fe.key === element.elementKey)?.displayName

if (friendlyName && placeHolders.indexOf(friendlyName) !== -1) {
replacedText = replacedText.replace(`${indicator}${friendlyName}${indicator}`, element.value as string ?? "")
replacedText = replacedText.replace(`${indicator}${friendlyName}${indicator}`, getValueAsString(element))
}
});
}
Expand Down

0 comments on commit abe0e11

Please sign in to comment.