slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.93k stars 3.41k forks source link

2.0.0-rc.3 Pressing enter/Adding new line resets bold/italic/underline formatting #4073

Open dr-zr opened 8 months ago

dr-zr commented 8 months ago

Quill editor resets the applied text format when the user presses Enter or even Shift+Enter. This issue happens on mobile and desktop. I've tested on rc2 and rc3.

Steps for Reproduction

  1. Visit https://quilljs.com/playground/snow
  2. Apply bold/italic/underline
  3. Start writing something
  4. Press enter or shift+enter
  5. Format will be reset

Expected behavior: The format is still applied after pressing (one) enter Actual behavior: Format is reset after pressing one enter

Platforms:

macOS: 14.4 (23E214)

Android:

iOS:

Version: 2.0.0-rc.2 & 2.0.0-rc.3

https://github.com/quilljs/quill/assets/155077894/9c794341-b934-4e0f-b388-e017be8e6911

cornelRaiu commented 8 months ago

@dr-zr this is intended behaviour. It's been the same in v1.3.7 and before.

I can see the need for an option to hit, for example, shift + enter and have it keep the current formatting settings.

dr-zr commented 8 months ago

@cornelRaiu thank you for the heads up. I haven't used Quill since rc2.

cornelRaiu commented 8 months ago

@dr-zr I'll make a pull request with the option to hit shift + enter to keep formatting settings. Hopefully it gets approved :)

dr-zr commented 8 months ago

Thank you soo much 🙏

qfm215 commented 8 months ago

I think it was not working like that in previous quill versions I was using the 1.3.7 version previously and when adding a new line quill was keeping the styling

cornelRaiu commented 8 months ago

@qfm215 I just checked on a 1.3.7 and it's true. It keeps the styling on new line. However, the v1.3.7 playground loses it. That's where I tested initially.

I just looked and the playground for v1.3.7 uses v2.0.0-beta.0: https://cdn.jsdelivr.net/npm/quill@2.0.0-beta.0/dist/quill.js

My bad :)

I'll still work on a pull request to make sure we at least have an option to switch this behaviour on.

qfm215 commented 8 months ago

No worries @cornelRaiu ;) I hope you will have this little improvement ready as soon as possible :)

minhnbdemetio commented 6 months ago

Are there any updates on this issue?

I'm running into the same problem and there's no option to disable this "intended behavior".

stephanieshin1 commented 4 months ago

It looks like it was intentionally removed in this commit