Skip to content

Commit

Permalink
Fixed help text position on toggle control and range control. (#5731)
Browse files Browse the repository at this point in the history
Help text appeared in the line instead of bellow the control as in all the other controls.
  • Loading branch information
jorgefilipecosta authored Mar 22, 2018
1 parent fe5274f commit 8d77d9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions components/base-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import './style.scss';
function BaseControl( { id, label, help, className, children } ) {
return (
<div className={ classnames( 'components-base-control', className ) }>
{ label && <label className="components-base-control__label" htmlFor={ id }>{ label }</label> }
{ children }
<div className="components-base-control__field">
{ label && <label className="components-base-control__label" htmlFor={ id }>{ label }</label> }
{ children }
</div>
{ !! help && <p id={ id + '__help' } className="components-base-control__help">{ help }</p> }
</div>
);
Expand Down
11 changes: 7 additions & 4 deletions components/range-control/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

.components-range-control {
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: center;
.components-base-control__field {
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: center;
}

.dashicon {
flex-shrink: 0;
Expand Down
4 changes: 2 additions & 2 deletions components/toggle-control/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.components-toggle-control {
.components-toggle-control .components-base-control__field {
display: flex;
justify-content: space-between;
}
}

0 comments on commit 8d77d9e

Please sign in to comment.