Skip to content

Commit

Permalink
BUGFIX: fix icons in MultiSelectBox
Browse files Browse the repository at this point in the history
  • Loading branch information
skurfuerst committed Sep 6, 2017
1 parent f36ca0e commit 135d428
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class DataSourceBasedSelectBoxEditor extends PureComponent {
values: PropTypes.objectOf(
PropTypes.shape({
label: PropTypes.string,
icon: PropTypes.string, // TODO test
icon: PropTypes.string,

// TODO
group: PropTypes.string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class SimpleSelectBoxEditor extends PureComponent {
values: PropTypes.objectOf(
PropTypes.shape({
label: PropTypes.string,
icon: PropTypes.string, // TODO test
icon: PropTypes.string,

// TODO
group: PropTypes.string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MultiSelectBox from './index.js';

const options = [
{value: 'opt1', label: 'Option 1'},
{value: 'opt2', label: 'Option 2'},
{value: 'opt2', label: 'Option 2', icon: 'bookmark'},
{value: 'opt3', label: 'Option 3'}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,15 @@ export default class MultiSelectBox extends PureComponent {
key={index}
className={theme.selectedOptions__item}
>
{
icon ?
<IconComponent className={theme.dropDown__itemIcon} icon={icon}/> :
null
}
<span>{ label }</span>
<span>
{
icon ?
<IconComponent className={theme.selectedOptions__itemIcon} icon={icon}/> :
null
}

{ label }
</span>
{
values && values.length == 1 && !allowEmpty ?
null:
Expand Down
4 changes: 4 additions & 0 deletions packages/react-ui-components/src/MultiSelectBox/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
vertical-align: middle;
}
}

.selectedOptions__itemIcon {
margin-right: .5em;
}
2 changes: 1 addition & 1 deletion packages/react-ui-components/src/SelectBox/index.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SelectBox from './index.js';
import DropDown from './../DropDown/index.js';

const options = [
{value: 'opt1', label: 'Option 1'},
{value: 'opt1', label: 'Option 1', icon: 'bookmark'},
{value: 'opt2', label: 'Option 2'},
{value: 'opt3', label: 'Option 3'}
];
Expand Down

0 comments on commit 135d428

Please sign in to comment.