JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.77k stars 316 forks source link

Uncaught error: Cannot read properties of null (reading 'sc') at HTMLDivElement.onKeyDown_wysiwyg (core.js:7312:1) #1457

Open petey9891 opened 1 month ago

petey9891 commented 1 month ago

Describe the bug When pressing Shift+Tab to unindent a numbered list, an uncaught error is thrown. I have been able to reproduce this error in every version of SunEditor from v2.43.14 onwards. It appears that this uncaught error was introduced in v2.44.0. The functionality works as expected in version 2.43.14.

To Reproduce Steps to reproduce the behavior:

  1. Create a numbered list and add text
  2. Press enter to create a second line
  3. Press tab to indent the numbered list and add text
  4. Press shift tab to unindent the point and the uncaught error will get thrown

Expected behavior The numbered list should become unindented.

Screenshots 1. Setting up to reproduce: Screenshot 2024-10-28 at 1 34 33 PM

2. After pressing shift+tab to unindent the second line, the error is thrown from core.js at line 7427: Screenshot 2024-10-28 at 1 36 46 PM

Screenshot 2024-10-28 at 1 41 31 PM

3. Expected result (present in v2.43.14): Screenshot 2024-10-28 at 1 35 36 PM

Desktop (please complete the following information):