Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content disappears when order is changed #37 #467

Closed
alonzrihan opened this issue Aug 16, 2023 · 4 comments
Closed

Content disappears when order is changed #37 #467

alonzrihan opened this issue Aug 16, 2023 · 4 comments
Labels
GitHub Issues that have been added to our internal issue tracker.

Comments

@alonzrihan
Copy link

What is the current behavior?

Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar.

we have a list of editors that can be reorder, when it does the content disappears in all editors

our code :

<div style={{ display: isReady ? 'flex' : 'none' }}>
        <Editor
          onInit={(_evt, editor): void => {
            editorRef.current = editor;
          }}
          tinymceScriptSrc="[path to scripts]"
          initialValue={initialValue.current} // we use initialValue for debounce
          onLoadContent={(): void => {
            !isReady && setIsReady(true);
          }}
          init={{
            width: '100%',
            menubar: false,
            images_upload_handler: imageUploadHandler,
            plugins: [
              'advlist',
              'autolink',
              'lists',
              'link',
              'image',
              'searchreplace',
              'fullscreen',
              'media',
              'table',
              'help',
              'wordcount',
              'codesample',
            ],
            toolbar: onChange ? 'fullscreen | styles fontsize | bold italic underline Strikethrough backcolor forecolor extraFormat | ' +
                  `bullist numlist alignment | outdent indent | link | table | ` : false,
            toolbar_groups: {
              extraFormat: {
                icon: 'more-drawer',
                tooltip: 'ExtraFormat',
                items: 'codesample removeformat',
              },
              alignment: {
                icon: 'align-left',
                tooltip: 'Alignment',
                items: 'alignleft aligncenter alignright alignjustify',
              },
            },
            toolbar_mode: 'floating',
            content_style: 'body { font-family:Helvetica,Arial,sans-serif; }',
            branding: false,
          }}
          onEditorChange={onChangeInternal}
          disabled={onChange === undefined || disabled || loading}
        />
      </div>

What is the expected behavior?
Show content in the right place

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-react?

tinymce: 6.6.2
tinymce-react: 4.3.0
OS: windows
Browser: edge
(didn't try other browsers and os since most of our customers uses this OS and browser)

Started working with tinyMCE in the past few weeks so didn't have the chance to try on previous versions

@TinyITAdmin TinyITAdmin added the GitHub Issues that have been added to our internal issue tracker. label Aug 16, 2023 — with Exalate Issue Sync
Copy link

Ref: INT-3221

@alonzrihan
Copy link
Author

what do you mean?

@danoaky-tiny
Copy link
Contributor

This is most likely because reordering the Editor component like this causes its internal iframe to lose state. This is because it would mean it's removed from the dom (albeit temporarily) and therefore losing all state within the iframe.

We can suggest workarounds that hide the editor or where the reordering is done with CSS, depends on your implementation.

@danoaky-tiny
Copy link
Contributor

Duplicate of #403

@danoaky-tiny danoaky-tiny marked this as a duplicate of #403 Nov 24, 2023
@danoaky-tiny danoaky-tiny closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub Issues that have been added to our internal issue tracker.
Projects
None yet
Development

No branches or pull requests

3 participants