mkhstar / suneditor-react

A React Component for SunEditor (WYSIWYG editor)
http://suneditor.com/
427 stars 105 forks source link

Removing List Item After Applying Bold Formatting Not Working Correctly #350

Open ashu-dev-ops opened 9 months ago

ashu-dev-ops commented 9 months ago

Describe the bug A bug occurs when trying to remove an item from a list after applying bold formatting to it. Instead of just removing the list formatting, the entire list item gets unexpectedly deleted. This issue arises specifically after a list item has been bolded and a subsequent attempt is made to unlist or change its format to normal text.

Related repository

To Reproduce

  1. Create a list in the editor (either numbered or bulleted).
  2. Add an item to the list.
  3. Apply bold formatting to this list item.
  4. Attempt to unlist or remove the list formatting from the bolded item.
  5. Observe that the entire list item gets deleted, instead of just losing its list formatting.

Expected behavior The expected behavior in this scenario is that after applying bold formatting to a list item, a user should be able to unlist it, converting it into a regular paragraph or line of text that retains the bold styling. The text itself should remain visible and not be deleted.

Screenshots Loom link => https://www.loom.com/share/4d57ea326fc5400a8a42f8f0fc6f1080?sid=97004fb2-1977-4ee4-b91f-caae974ab171

Code Sandbox Demo https://codesandbox.io/p/github/ashu-dev-ops/sun_editor/draft/infallible-turing?file=%2Fsrc%2FApp.js&workspaceId=cb501c97-5bbb-44d5-83b6-22a987ebb59d

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

ashu-dev-ops commented 9 months ago

happening when list contains an strong

  1. Apple 
  2. Mango