简体   繁体   English

Tinymce 编辑器代码插件在 React 中不起作用 Model

[英]Tinymce Editor Code Plugin Not Working in React Model

I'm using Windmill React UI for Popup.我正在使用 Windmill React UI for Popup。
Inside popup I'm using Tinymce editor for storing email templates.在弹出窗口中,我使用 Tinymce 编辑器来存储 email 模板。
Editor is showing but in source code popup I'm not able to edit.编辑器正在显示,但在源代码弹出窗口中我无法编辑。

Please help me to fix this issue.请帮我解决这个问题。 Thanks in advance.提前致谢。

<Editor
 onChange={(e) => { setEmailContent(e.target.getContent()) }}
 apiKey=''
 init={{
  height: 300,
  menubar: false,
  contextmenu: 'cut copy paste',
  branding: false,
  plugins: 'advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code fullscreen insertdatetime media table paste help wordcount',
  toolbar: 'code preview | undo redo | paste image media link | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat',
 }}
/>

This is most likely due to your "modal" dialog not relinquishing focus.这很可能是由于您的“模态”对话框没有放弃焦点。 Since there is no such thing as a modal in plain HTML your choice of modal is likely a combination of HTML and Javascript (eg Windmill) and it is not wanting to let go of focus. Since there is no such thing as a modal in plain HTML your choice of modal is likely a combination of HTML and Javascript (eg Windmill) and it is not wanting to let go of focus. You will need to figure out how to tell your modal code to allow something else to get control.您将需要弄清楚如何告诉您的模态代码以允许其他东西获得控制。

The TinyMCE documentation has an example of how to do this for Bootstrap: TinyMCE 文档有一个如何为 Bootstrap 执行此操作的示例:

https://www.tiny.cloud/docs/integrations/bootstrap/#usingtinymceinabootstrapdialog https://www.tiny.cloud/docs/integrations/bootstrap/#usingtinymceinabootstrapdialog

As you are using a different technology you will need to determine how to do something similar.当您使用不同的技术时,您需要确定如何做类似的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM