Skip to content

Commit 39c1cdb

Browse files
[SDCP-1031] - Image uploaded to body_html or feature media does not remove the upload dialogue at the end (#5020)
* Added guardrail for CharacterCount in case number is sent * Suggested fix
1 parent f569ca3 commit 39c1cdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/apps/authoring/authoring/components/CharacterCount.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ interface IProps {
1010
item: string;
1111
}
1212

13-
export function getEditorFieldCharactersCount(text: string, html?: boolean) {
14-
let input = text?.trim() ?? '';
13+
export function getEditorFieldCharactersCount(text: string | number, html?: boolean) {
14+
let input = `${text ?? ''}`.trim();
1515

1616
input = html ? cleanHtml(input) : input;
1717
input = input.replace(/\r?\n|\r/g, '');

0 commit comments

Comments
 (0)