@@ -7,6 +7,7 @@ import useTrans from '@/hooks/useTrans';
77import { getTextSize } from '@/UI/getTextSize' ;
88import IMSSTextbox from '@/Stage/TextBox/IMSSTextbox' ;
99import { compileSentence } from '@/Stage/TextBox/TextBox' ;
10+ import { useState } from 'react' ;
1011
1112export const TextPreview = ( props : any ) => {
1213 const t = useTrans ( 'menu.options.pages.display.options.' ) ;
@@ -29,6 +30,12 @@ export const TextPreview = (props: any) => {
2930
3031 const Textbox = IMSSTextbox ;
3132
33+ const [ previewKey , setPreviewKey ] = useState < number > ( 0 ) ;
34+
35+ const forcePreviewUpdate = ( ) => {
36+ setPreviewKey ( ( prevKey ) => prevKey + 1 ) ;
37+ } ;
38+
3239 const textboxProps = {
3340 textArray : previewTextArray ,
3441 isText : true ,
@@ -37,7 +44,7 @@ export const TextPreview = (props: any) => {
3744 showName : showNameArray ,
3845 currentConcatDialogPrev : '' ,
3946 fontSize : size ,
40- currentDialogKey : '' ,
47+ currentDialogKey : String ( previewKey ) ,
4148 isSafari : isSafari ,
4249 isFirefox : isFirefox ,
4350 miniAvatar : '' ,
@@ -55,6 +62,7 @@ export const TextPreview = (props: any) => {
5562 style = { {
5663 background : previewBackground ? `bottom / cover no-repeat url(${ previewBackground } )` : 'rgba(0, 0, 0, 0.1)' ,
5764 } }
65+ onClick = { forcePreviewUpdate }
5866 >
5967 < div key = { `previewTextbox-${ textDelay } ` } className = { styles . textbox } >
6068 < Textbox { ...textboxProps } />
0 commit comments