RichEditor new lines are double spaced
Is there a way of making it so that when you hit return, it only goes to the next line instead of two lines down? It's as though it's permanently lodged in double spaced mode.
Normally with this, shift and return takes you to the next line, but not in this case.
11 Replies
Is it actually two lines or does it just look like it. Normally enter creates a new paragraph which depending on the styling can look larger or smaller.
So how do I just move the cursor to the line below?
That’s what I’m saying the line below might be a visual misrepresentation.
Okay, but even so it looks like there’s a one line gap between each line!
If you hit enter and then hit the up arrow does it go to an empty line or to the end of the paragraph above it.?
It goes to the paragraph above. I can’t see a way to type in the line inbetween.
That’s because there is no line between that the margin between the paragraphs.
I think something is messing with your css.
Granted tailwind typography tends to have, in my opinion, overly large margins between its paragraphs. Maybe that’s the issue.
Yeah it isn’t doing it on the demo site, so it just be related.
The only thing I want my “custom theme” to do is replace the default orange with tailwind’s primary blue!
But it seems like it introduces extra quirks like this.
It shouldn’t. I haven’t had any issues with custom themes.
Strange. Ok thanks, I’ll try and drill down to see what css is causing it. (I’ll post back if I found a solution).
I was able to resolve this with:
trix-editor p {
margin-bottom: 0 !important;
margin-top: 0 !important;
}
Still not quite sure why it was happening though!
It was probably using the prose class from Tailwind typography, which is why I mentioned that it can be a little over eager on spacing. Glad you found a solution for your needs though.
WYSIWYG editors are always a pain in the ass. Trix is no exception.