When nesting <Select multiple inline> inside <FormField>, options have significant whitespace issues
See original GitHub issueExpected Behavior
A <Select multiple inline>
component should render correctly when used inside a <FormField>
component.
Actual Behavior
The <Select>
options display with what looks like a huge amount of padding above each option (see screenshot / codepen).
What I think is actually happening is something like this:
- Using
<Select multiple inline>
causes the options to be rendered using<Checkbox>
internally. - The
<Checkbox>
component uses a zero-height, zero-width, zero-opacity<input type="checkbox">
, and renders a nicer-looking checkbox with SVG. Essentially, the original input is hidden without explicitly usingdisplay: none
. - Something in the
<FormField>
styles (probably this line) is explicitly setting a height for the<input>
, which is intended to be “hidden”, breaking the layout of the<Checkbox>
.
URL, screen shot, or Codepen exhibiting the issue
Codepen: https://codepen.io/ezzatron/pen/WXGoJe
Screenshot:
Steps to Reproduce
- Nest a
<Select inline multiple>
with some options inside a<FormField>
- Observe whitespace issues
Your Environment
- Grommet version: 1.8.3
- Browser Name and version: Chrome 61.0.3163.100, also Firefox
- Operating System and version (desktop or mobile): macOS Sierra
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How do I evenly add space between a label and the input field ...
First of all, use label instead of span . It's meant to be paired with inputs and preserves some additional functionality (clicking label ......
Read more >How whitespace is handled by HTML, CSS, and in the DOM
If there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words ......
Read more >Setting the height of react-select · Issue #1322 - GitHub
I am having a hard time setting the height of react-select. ... Look for a deeply nested one that has a div inside...
Read more >Forms in HTML documents - W3C
An HTML form is a section of a document containing normal content, markup, special elements called controls (checkboxes, radio buttons, menus, etc.), and...
Read more >How to Customize the Style of Individual Form Fields - WPForms
In this tutorial, we'll provide a list of nearly any selector you might need to style individual fields on your forms. Note: This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the fix!
A temporary workaround: wrap the offending
<Select>
in a<Box>