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

Copy/Cut/Paste of formatted text is not working correctly in Jodit app and playground #1202

Open
gauraws opened this issue Dec 2, 2024 · 0 comments

Comments

@gauraws
Copy link

gauraws commented Dec 2, 2024

Jodit Version: 4.2.10

Browser: Chrome
OS: Windows & Mac
Is React App: True(Nextjs)
Reproduced on xdsoft.net: True

Code

// jodit-react
import { IJoditEditorProps } from 'jodit-react';
const JoditEditor = dynamic(() => import('jodit-react'), {
  ssr: false
});


const buttonOptions: string[] = [
  'bold',
  'italic',
  'underline',
  'ul',
  'ol',
  'image',
  'table',
  'link',
  'undo',
  'redo',
  'eraser',
  'fullsize',
];

// more-code

const config = useMemo(
    () =>
      ({
        readonly: disabled,
        placeholder: placeholder,
        buttons: buttonOptions,
        toolbarAdaptive: false,
        askBeforePasteHTML: false,
        askBeforePasteFromWord: false,
        showCharsCounter: false,
        showWordsCounter: false,
        showXPathInStatusbar: false,
        addNewLineOnDBLClick: false,
        hidePoweredByJodit: true,
        autofocus: false,
        addNewLine: false,
        uploader: {
          insertImageAsBase64URI: true,
        },
        enter: 'div',
        createAttributes: {
          table: {
            style: 'border-collapse:collapse; width: 100%;',
          },
          tr: { style: ' border: 1px solid #C5C6C8FF;' },
          td: { style: ' border: 1px solid #C5C6C8FF;' },
        },
      }) as IJoditEditorProps['config'],
    [disabled, placeholder],
  );

//more code

<JoditEditor
  value={value}
  config={config}
  onChange={(value) => {
    onChange(value);
  }}
 />

Expected behavior:
Text formatting should work correctly on copy/cut/paste and formatting should be retained whenever text is cut or copied and pasted in some other part of the editor.

Actual behavior:
If a text is formatted and the same is cut and pasted some other place, text formatting is lost(not retained). Please see screen recording below

Screen recording

Screen.Recording.2024-12-02.at.5.19.18.PM.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant