Closed waseemViwell closed 7 months ago
Ref: INT-3216
@TinyITAdmin can you please provide a little bit of information about Ref: INT-3216 can you please paste issue link here
Hi @waseemViwell,
This is because the editor does not re-initialize when the init props are changed. You can force a reinit by changing the key of the component. See codesandbox: https://codesandbox.io/s/zealous-lena-sfggp7?file=/src/index.js
Description I'm facing an issue while trying to dynamically set the directionality of the text in the TinyMCE editor based on the input content. I want the directionality to change to RTL (right-to-left) when the input content is in a RTL language, and to LTR (left-to-right) otherwise.
Steps to Reproduce
Expected Behavior The directionality of the text in the TinyMCE editor should change to RTL when inputting RTL content, and to LTR for other content.
Actual Behavior The directionality of the text remains static and does not change based on the input content.
Additional Information Using TinyMCE in a React application. The getLangDir function is used to determine the directionality based on input content. The direction state is updated in the handleEditorChange function. The directionality setting is initially set in the init configuration of TinyMCE. The editor's directionality does not dynamically change as input content changes.