Skip to content

Commit

Permalink
Fix vertical alignment of inline form units in IE [#153417045]
Browse files Browse the repository at this point in the history
Signed-off-by: Reid Mitchell <rmitchell@pivotal.io>
  • Loading branch information
Jonathan Berney authored and pivotal committed Dec 7, 2017
1 parent 7188b21 commit 05cb424
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/pivotal-ui-react/form/form-unit_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ describe('FormUnit', () => {
expect('.form-unit .grid:eq(0) > .col:eq(0)').toHaveText('Instance Name');
expect('.form-unit .grid:eq(0) > .col:eq(1)').toHaveText('hello');
});

it('applies the "inline-form-unit" class to the form unit', () => {
expect('.form-unit').toHaveClass('inline-form-unit');
});
});

describe('hideHelpRow', () => {
Expand Down
6 changes: 6 additions & 0 deletions src/css/forms/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,12 @@ textarea.valid {
}
}

&.inline-form-unit {
.field-row {
height: 32px;
}
}

&.has-error {
.help-row {
color: $input-invalid-text;
Expand Down
2 changes: 1 addition & 1 deletion src/react/forms/form-unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class FormUnit extends React.Component {
) : sections;

return (
<div className={classnames('form-unit', className, {'has-error': hasError})}>
<div className={classnames('form-unit', className, {'has-error': hasError, 'inline-form-unit': inline})}>
{content}
{helpRow}
</div>
Expand Down

0 comments on commit 05cb424

Please sign in to comment.