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

Improve display of shortcode block in columns #11079

Closed
billerickson opened this issue Oct 25, 2018 · 7 comments · Fixed by #20624
Closed

Improve display of shortcode block in columns #11079

billerickson opened this issue Oct 25, 2018 · 7 comments · Fixed by #20624
Assignees
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@billerickson
Copy link

Describe the bug
The shortcode block label is floated to the left of the textarea. While this works well in larger contexts, inside the columns block this shrinks the texarea down to one character per line:

To Reproduce
Steps to reproduce the behavior:

  1. Add the Columns block and set it to 3 columns
  2. Add the Shortcode block to each column.

Expected behavior
The textarea should be larger and more usable. Float the label above the textarea and make them both full width.

Screenshots
screen shot 2018-10-25 at 1 55 17 pm

@designsimply designsimply added [Type] Enhancement A suggestion for improvement. Needs Testing Needs further testing to be confirmed. [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P labels Oct 25, 2018
@arunsathiya
Copy link
Contributor

Can reproduce this as well on Gutenberg 4.1.1 with WordPress 4.9.8 on Google Chrome Version 70.0.3538.67 (Official Build) (64-bit). macOS 10.14 - Mac OS Mojave.

3 shortcode blocks inside the columns block

screenshot 2018-10-26 at 16 42 01

Image indicating how the shortcode block content region is small when the shortcode label is on the left

On adding more text

screenshot 2018-10-26 at 16 42 19

Another image indicating how the shortcode block content region is small when the shortcode label is on the left

Suggested format

I am going to take a stab at submitting a PR for this to bring it in the format shown below.

screenshot 2018-10-26 at 16 41 26

Image indicating the shortcode label at the top of the content, as opposed to being on the left

@billerickson
Copy link
Author

billerickson commented Dec 9, 2018

Can the fix be as simple as changing display: flex to display: block when in a column?

.wp-block-columns .wp-block-shortcode { display: block; }

screenshot

@bobbingwide
Copy link
Contributor

bobbingwide commented Feb 1, 2019

A temporary fix when you're editing a shortcode is to edit the CSS to
.wp-block-shortcode label { display: none; }

and/or do as Bill suggested and disable the padding as well.
image

For the front-end view see https://wordpress-seo.wp-a2z.org/

@bobbingwide
Copy link
Contributor

bobbingwide commented Apr 22, 2019

With Gutenberg 5.5.0 I now get
image

This is due to a new problem. #15032

@ThornedRose
Copy link

ThornedRose commented May 12, 2019

I'm on Wordpress 5.2, and I still have the OP's behaviour with shortcodes (7 months after it was posted!).

Adding .wp-block-shortcode label { display: none; } or .wp-block-columns .wp-block-shortcode { display: block; } mostly works but as the shortcodes themselves are quite long, it still looks bizzare. Nor is this a solution to pass onto the non-profit clients I am doing this website for :(

@talldan
Copy link
Contributor

talldan commented Feb 20, 2020

This does look a bit better now:
Screenshot 2020-02-20 at 2 03 53 pm

The text area is wider and is properly multiline now. But I still feel there's room for improvement, i.e. making the text area take up the full-width. It seems unusual that there's an empty space down the right hand side.

Not sure this can be labelled a bug given the original issue has been improved considerably, so I'll stick with the existing Enhancement label and also label that it needs design feedback on the above suggestion.

@talldan talldan added Needs Design Feedback Needs general design feedback. and removed Needs Testing Needs further testing to be confirmed. labels Feb 20, 2020
@mapk
Copy link
Contributor

mapk commented Mar 3, 2020

I agree with @talldan here. The alignment issues have been resolved, but it would be good to set the textarea width to 100%.

Currently

Screen Shot 2020-03-03 at 9 24 42 AM

Width at 100%

Screen Shot 2020-03-03 at 9 25 55 AM

@mapk mapk added Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Mar 3, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
7 participants