Skip to content
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

Have multiple empty paragraph breaks -> convert to spacer block #17366

Closed
paaljoachim opened this issue Sep 7, 2019 · 11 comments
Closed

Have multiple empty paragraph breaks -> convert to spacer block #17366

paaljoachim opened this issue Sep 7, 2019 · 11 comments
Labels
[Block] Paragraph Affects the Paragraph Block [Block] Spacer Affects the Spacer Block Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@paaljoachim
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I find it cumbersome to have to add so many spacer blocks to gain some margin/padding in the layout. Having another quicker way to add the spacer block would help.

Describe the solution you'd like
@melchoyce mentioned this:
"One thing that could be cool re: spacer block, it automatically converting multiple paragraph breaks (say, three or more) into a spacer block."
#11824 (comment)

I found it a very interesting idea! As one could easily press enter multiple times (three or more times) and have a spacer block inserted. A lot quicker then having to manually add the spacer block.

@swissspidy swissspidy added [Block] Paragraph Affects the Paragraph Block [Block] Spacer Affects the Spacer Block [Type] Enhancement A suggestion for improvement. labels Sep 19, 2019
@ellatrix
Copy link
Member

When would that conversion happen? Cc @melchoyce.

@melchoyce
Copy link
Contributor

I think the third time you press enter, we should turn those paragraph breaks into one spacer.

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Mar 18, 2020

I think we might need design to look this over and give it a thumbs up so we can add the need dev label. We might also need a larger discussion around this issue. I have added a comment to the core editor agenda.
@mapk

@mapk
Copy link
Contributor

mapk commented Mar 25, 2020

I love this idea and saw something like this with @phpbits' plugin I think.

Should we communicate to the user when this happens? Any sort of notification like a snackbar?

@melchoyce
Copy link
Contributor

A snackbar is a good idea, maybe paired with an "undo" link?

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Mar 25, 2020

These are good ideas!

@paaljoachim
Copy link
Contributor Author

I think we are about ready to get a PR going.

@paaljoachim
Copy link
Contributor Author

Here is what the notification can look like:
Convert-to-Spacer-Gutenberg

@jasmussen
Copy link
Contributor

#27995 was just merged, which makes sure a linebreak in the editor shows up as a linebreak on the frontend.

Does that mitigate or even fix this issue?

@paaljoachim
Copy link
Contributor Author

I am not sure Joen. Let's test out the merged PR in the next version of Gutenberg and get a feel for it.

@paaljoachim
Copy link
Contributor Author

Closing this issue, as it has mostly been taken care of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Block] Spacer Affects the Spacer Block Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants