-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
How to add difference between ENTER and SHIFT+ENTER #1187
Comments
2019 Developers: Your best shot is here https://codepen.io/mackermedia/pen/gmNwZP Quill really is great. But, from the blog:
Yet the document model you are so proud of cannot simply produce a |
@VaelVictus your sample is buggy. You can reproduce with:
|
Which, indeed, is why I said it was your best shot in 2019. |
@VaelVictus you should try this workaround, works fine for me :) |
Original thread is locked now, but I had issues with workarounds and Deltas they produced. When I did
The only issue I had, was forcing Quill not to place any content into the So the whole code looks like this:
Because the original issue is opened for almost 4-5 years now, I hope this helps. |
Quill gets hyped but is still missing standards that other editors have out-of-the-box. And this issues was brought up already in 2014 ... Personally I am sticking to SCEditor as long as this is not default. This "heavy" workaround seems to work: https://codepen.io/mackermedia/pen/gmNwZP |
Thanks for that heavy workaround link. I have actually since adopted Pell and this was a driver to do so. |
I must admit I was surprised when I realized that I quite like Quill, and how easy it is to integrate - I will have a look at the solutions proposed so far to add this functionality, as everyone who will be using it in my project know how to use and need both paragraphs and newlines. I really think it should be added to the core 👍 |
I have same issue course I tried to use Devextreme HTMLEditor which is using Quill, there I see no change to replace it easily. When I try hack it via direct DOM injection Quill removes BR immediately. I hate it boths :( |
It wourks when u use pure Quiil, but no chance when it is wrapped |
I might not understand that code entirely, but changing:
inside the class to:
fixed the issue for me. |
For anyone using React-Quill this worked for me: The only problem is that after pressing enter, backspace has to be pressed twice to return to the previous line. If anyone has a solution for that please let me know! |
Not sure why answers here are so complicated. I just did this in the Quill config:
For the Breaker blot I did:
I had to also add the blotName 'breaker' to the list of formats in the Quill config. I am using I would say that if you're having issues with the way br tags and p tags are rendered in your editor and your actual display of the data then you should look into manually theming quill. I found the quill.core.css file was styling a lot of tags and I wanted a context agnostic editor that left styling to the page it's on. |
This works great when writing text, but not on copy-paste, do you have any fix for that? Edit: this solution seems to work zenoamaro/react-quill#513 (comment) |
As for the buggy but useful example provided by @VaelVictus - I improved it by adding/extending a couple of handlers, taking care of the following problems:
The only problem that remains and that I have not been able to solve is the "double backspace" tap that's needed to remove the The example sadly had to be written in old coffee script but just throw it in an online converter and you're ready to go.
|
This is such a hacky solution, if one could call it a solution at all. I guess the problem is that the author didn't anticipate this while constructing the inner logic of the project, so it probably isn't trivial to add this in a robust manner. Unfortunately the project i'm working on requires this functionality so i'm giving up on Quill for now. |
How in the world is this still an issue? This is literally one of the most obvious features a wysiwyg editor should have. Can someone on the dev team PLEASE explain why you refuse to add this after almost 10 years of requests? |
Just use TinyMCE 6. :} You can test for this functionality right here: https://www.tiny.cloud/docs/tinymce/6/ |
This is by far the best implementation of Shift + Enter for Quill
|
Worked like charm for |
Hi Jason,
Just wonder how can I add difference between paragraph and new line entries.
For example ENTER should always create new paragraph, but SHIFT+ENTER should add brake-line.
Thanks for you help,
Filip
The text was updated successfully, but these errors were encountered: