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

Tab key causing uncaught error #660

Closed
peter-chow opened this issue Mar 12, 2021 · 4 comments
Closed

Tab key causing uncaught error #660

peter-chow opened this issue Mar 12, 2021 · 4 comments
Labels
Milestone

Comments

@peter-chow
Copy link

Hello,

I'm experiencing an issue where pressing the tab key in the editor doesn't insert a tab but instead causes an uncaught error (this is through the suneditor-react module):

Uncaught TypeError: Cannot read property 'toString' of undefined
at Object.getByteLength (main.js:947)
at Object.getCharLength (main.js:2206)
at Object.checkCharCount (main.js:2200)
at Object.insertNode (main.js:1921)
at HTMLDivElement.onKeyDown_wysiwyg (main.js:2308)

This error occurs when you specify a value for: maxCharCount, and set the charCounterType to: byte-html. If you set, charCounterType to: char or byte, no error is thrown.

This is using version 2.36.5.

Regards,
Peter

@JiHong88
Copy link
Owner

@peter-chow The issue is not reproduced.
Please tell me about the other options you have used and the test environment.

@peter-chow
Copy link
Author

@JiHong88, the following options have been specified:

{
buttonList: [['undo', 'redo'], ['formatBlock'], ['bold', 'underline', 'italic', 'removeFormat'], ['outdent', 'indent', 'align'], ['link', 'list', 'table']],
formats: ['p', 'h1', 'h2', 'h3', 'blockquote'],
resizingBar: false,
showPathLabel: false,
maxCharCount: 100,
charCounterType: 'byte-html'
}

The issue can also be reproduced on the SunEditor Option page (http://suneditor.com/sample/html/options.html) by specifying a maxCharCount and setting the charCounterType to "byte-html". This occurs on Edge, Chrome and Firefox,

@JiHong88 JiHong88 added the bug label Mar 13, 2021
@JiHong88 JiHong88 added this to the 2.37.0 milestone Mar 13, 2021
JiHong88 added a commit that referenced this issue Mar 13, 2021
_fix: util.getByteLength exception handling
@JiHong88
Copy link
Owner

The 2.37.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

@peter-chow
Copy link
Author

Thanks @JiHong88. I'll give it a test.

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

2 participants