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

Error with StrictMode option for _setDefaultFormat #1401

Closed
ilcary opened this issue May 22, 2024 · 8 comments
Closed

Error with StrictMode option for _setDefaultFormat #1401

ilcary opened this issue May 22, 2024 · 8 comments
Labels
Milestone

Comments

@ilcary
Copy link

ilcary commented May 22, 2024

Describe the bug
On the last version of the SunEditor 2.46.2 the StrictMode option is causing a input managment error.
While the flag StrictMode is true the suneditor on the onKeyUp_wysiwyg function and more exactly in the _setDefaultFormat is throwing the error: Uncaught TypeError: format is undefined

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'SunEditor with these configs:
    { "strictMode": true, "value": "<span>Ciao</span>", "mode": "classic", "rtl": false, "katex": "window.katex", "resizingBar": false, "showPathLabel": false, "resizeEnable": false, "imageResizing": false, "imageHeightShow": false, "imageAlignShow": false, "imageFileInput": false, "imageUrlInput": false, "videoResizing": false, "videoHeightShow": false, "videoAlignShow": false, "videoFileInput": false, "videoUrlInput": false, "videoRatioShow": false, "audioUrlInput": false, "tabDisable": false, "shortcutsHint": false, "mediaAutoSelect": false, "buttonList": [ [ "undo", "redo", "font", "fontSize", "formatBlock", "paragraphStyle", "blockquote", "bold", "underline", "italic", "strike", "subscript", "superscript", "fontColor", "hiliteColor", "textStyle", "removeFormat", "outdent", "indent", "align", "horizontalRule", "list", "lineHeight", "table", "link", "image", "video", "audio", "math", "imageGallery", "fullScreen", "showBlocks", "codeView", "preview", "print", "save", "template" ] ], "lang": "SUNEDITOR_LANG.it", "lang(In nodejs)": "it" }

'
2. Click on 'With focus on the text value -> press "Enter then Ctrl + A, then backspace"
As you can see from the attach:

image

'

Expected behavior
To manage properly the input without strictMode active :)

Desktop:

  • OS: [Windows]
  • Browser [Firefox]
  • Version [126.0]

Desktop 2:

  • Device: [Desktop]
  • OS: [Windows]
  • Browser [Chrome]
  • Version [124.0.6367.210]
@77DDS77
Copy link

77DDS77 commented May 22, 2024

Had the same issue, wasn't able to solve. I'll follow the thread to see any updates on this, best of luck.

@JiHong88 JiHong88 added this to the 2.46.3 milestone May 23, 2024
@Kryostatic94
Copy link

Please I have the same error and I can't solve it, I will follow this topic for updates

@johnnybaida
Copy link

+1

@davide-lombardo
Copy link

Same issue here, I'll follow to see any updates on this.

@JiHong88
Copy link
Owner

Could it be a browser cache issue?
I cannot reproduce the issue.

@johnnybaida
Copy link

johnnybaida commented May 28, 2024

Could it be a browser cache issue? I cannot reproduce the issue.

I am using Firefox version 126.0 and it does not seem to be a caching problem.

I tried it this way:

  1. Open this link: http://suneditor.com/sample/html/examples.html
  2. Select the strictMode checkbox
  3. Select the Value checkbox
  4. Write in the Value textarea the following HTML code: <span>Ciao</span>
  5. Click on the Create button
  6. Click inside the editor, with the focus at the end of the word Ciao
    immagine
  7. Press Enter from keyboard to wrap
    immagine
  8. Press CTRL+A to select all the text (on Windows)
    immagine
  9. Press BackSpace from keyboard to delete
    immagine

@JiHong88 JiHong88 added the bug label May 28, 2024
@JiHong88
Copy link
Owner

@johnnybaida Thank you.
I will release a new version asap.

JiHong88 added a commit that referenced this issue May 28, 2024
@JiHong88
Copy link
Owner

Version 2.46.3 has been updated.
thank you

onedark23 pushed a commit to damoang/suneditor that referenced this issue Jun 7, 2024
onedark23 pushed a commit to onedark23/suneditor that referenced this issue Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants