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

Editor: Fix Block Embed Input size #19438

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Conversation

ItsJonQ
Copy link

@ItsJonQ ItsJonQ commented Jan 6, 2020

This update fixes the Input vs. Button sizing and alignment as seen in Embed
blocks, such as Instagram, Twitter, or YouTube.

The problem stemmed from the Placeholder component from @wordpress/components.
The display: flex container caused the input to grow responsively
(height wise), which was triggered by the mysterious margin below the button.

The solution involved neutralizing the margins for both the input and button
elements, allowing for their heights and alignments to match.

How has this been tested?

Tested locally in Gutenberg

Screenshots

Before

Screen Shot 2020-01-06 at 12 23 51 PM

After

Screen Shot 2020-01-06 at 12 23 26 PM


Margin inconsistencies

Screen Shot 2020-01-06 at 12 22 48 PM

Screen Shot 2020-01-06 at 12 22 31 PM

Types of changes

The code was introduced in the @wordpress/components layer, for the Placeholder component. Given how this Component is used within Gutenberg, I feel like this adjustment in margins is a safe fix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

Resolves #19420

This update fixes the Input vs. Button sizing and alignment as seen in Embed
blocks, such as Instagram, Twitter, or YouTube.

The problem stemmed from the Placeholder component from `@wordpress/components`.
The `display: flex` container caused the `input` to grow responsively
(height wise), which was triggered by the mysterious margin below the button.

The solution involved neutralizing the margins for both the `input` and `button`
elements, allowing for their heights and alignments to match.
@ItsJonQ ItsJonQ added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Jan 6, 2020
@ItsJonQ ItsJonQ requested a review from karmatosed January 6, 2020 17:31
@ItsJonQ ItsJonQ self-assigned this Jan 6, 2020
Copy link
Member

@karmatosed karmatosed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and fixes the issue, thanks!

@karmatosed karmatosed merged commit b095061 into master Jan 6, 2020
@karmatosed karmatosed deleted the fix/block-embed-input-size branch January 6, 2020 20:59
@youknowriad
Copy link
Contributor

Could this have impacted the table block placeholder

Capture d’écran 2020-01-07 à 8 59 00 PM

@ItsJonQ
Copy link
Author

ItsJonQ commented Jan 7, 2020

@youknowriad Oh dear! Let me take a look

@ItsJonQ
Copy link
Author

ItsJonQ commented Jan 7, 2020

@youknowriad Update!~ Yes it did. Although... looking at the Table Block placeholder styles... the relationship of the margins x child elements feel strange.

I'm going to follow up with an update to hopefully address both Embed + Table Blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input larger than embed button
4 participants