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
Quill inserts a useless line-break before the <ul> element #2905
Comments
After playing a little bit i found two ways to prevent quill to insert the line-break
|
I'm experiencing the same issue. This is frustrating a client of mine because if they make any change (make a word bold for example), a new empty |
I'm having the same issue |
I'm having the same issue as well. Looking through the code. The problem appears to be that on load, Quill is inserting a Block blot (p) tag before the ul, which by default contains a br as a child. Presumably that is the default behavior so the user can click there and type after creating it. I'm working my way up the chain to see if I can find what is actually making the decision to insert that item. |
Same problem, please fix =) |
I fixed it by disabling matchVisual, but I think we should find better solution.
|
I have the same problem and i found another solution. But its not a good one, so i still hope that this Bug got fixed properly. setContents() wants a delta object. And we just force a linebreak at the end of this delta object. So that not only at the end of our bugy delta object is a linebreak. Its at the end of all of them. And then we hide the linebreak with CSS. Javascript
SCSS
edit: changed the javascript code again. had still a few bugs. but now its working properly i think. |
@Triggsy22 thanks for sharing. I plan to take a look at this further. For my own clarity, where did you implement the |
|
Recreated the issue with a simple page based on the example usage provided. You can see that the extra line is created if a single paragraph is followed by the bullets. Two consecutive paragraphs will not give the same error. |
it a appears as though that was the ultimate solution in later versions of quill: |
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide 🙏 |
Unfortunately quill insert a line-break if you paste the following html into the editor:
<p>Simple list:</p><ul><li>item one</li><li>item two</li></ul><p><br></p>
The behavior of
pasteHTML()
orconvert(), setContents()
is the same.Steps for Reproduction
var html = <p>Simple list:</p><ul><li>item one</li><li>item two</li></ul><p><br></p>;
Expected behavior:
Quill should not insert an line-break before the
<ul>
- because this sums up.The first time it insert a line-break, then we save it, then quill inserts the second line-break, we save again, and so on...
Actual behavior:
Simple list:
Platforms:
Chrome 79
Windows 10
Version:
1.3.7
Run
Quill.version
to find outThe text was updated successfully, but these errors were encountered: