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

Button Block: Newly added block is too narrow #1168

Closed
aduth opened this issue Jun 14, 2017 · 7 comments
Closed

Button Block: Newly added block is too narrow #1168

aduth opened this issue Jun 14, 2017 · 7 comments
Labels
[Feature] Blocks Overall functionality of blocks Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Jun 14, 2017

Steps to Reproduce:

  1. Navigate to Gutenberg -> New Post
  2. Insert a Button block

Expected result:

A button block is appended and shown with placeholder text visible.

Actual result:

The button block is appended, but only with enough space for the padding. The placeholder is cropped.

Button

Solution ideas:

  • Ideally the button width would be enough to fit the placeholder text, regardless of what the text contains (i.e. not a fixed value width)
  • Alternatively, a minimum fixed value width on the button could be sufficient
@aduth aduth added [Feature] Blocks Overall functionality of blocks Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended labels Jun 14, 2017
@paaljoachim
Copy link
Contributor

I just looked at the CSS and added a width of 150px to it.

.blocks-button {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    display: inline-block;
    text-decoration: none;
    font-size: 18px;
    margin: 0;
    padding: 0 24px;
    height: 46px;
    line-height: 46px;
    cursor: default;
    border-radius: 23px;
    white-space: nowrap;
    background: #33B3DB;
    color: #fff;
    vertical-align: top;
    position: relative;
    width: 150px;
}

The result with the added 150px now look like this:

screen shot 2017-06-14 at 23 25 28

There should of course be button options on the right side but that is another matter, and there should not be so many overlapping toolbars.

@abaicus
Copy link
Contributor

abaicus commented Jun 15, 2017

Maybe giving it a min-width as long as the button still has the placeholder?

@jasmussen
Copy link
Contributor

I agree we should have a min width, somehow, but I believe the reason we didn't add this was that we were hoping that the placeholder text itself could define the size of the button. This would also help with translations requiring different min widths. Cc @iseulde, I think you may have some context.

@georgeolaru
Copy link

georgeolaru commented Jun 16, 2017

That could be easily improved if the position: absolute is removed from the .blocks-editable__tinymce[data-is-empty="true"]:before CSS rule:

@jasmussen
Copy link
Contributor

Nice @georgeolaru! @iseulde can you tell if removing the abs positioning would have any negative side effects on the placeholder text?

@abaicus
Copy link
Contributor

abaicus commented Jun 17, 2017

@jasmussen I think that the only downside to this would be that when you focus the input, the marker would be blipping at the end of the placeholder. It empties itself only when you start typing. Otherwise I think it's ok.

jasmussen added a commit that referenced this issue Jun 19, 2017
This tries to address #1168, specifically the concerns around letting the placeholder text scale the content.
@ellatrix
Copy link
Member

Fixed in #1477.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants