Skip to content

Commit 5d19df1

Browse files
author
kubraturan
committed
object status of dropdown items was checked.
1 parent 07beefa commit 5d19df1

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/Dropdown/Dropdown.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ export class Dropdown extends Component {
4444
this.props.items.map((x, i) => (
4545
<li key={i} onMouseDown={(e) => this.props.onSelect(i)}>
4646
{
47-
x.icon ?
48-
<span className='rce-button-icon--container'>
49-
{(x.icon.float === 'right' || !x.icon.float) && <a>{x.text}</a>}
47+
x instanceof Object ?
48+
x.icon ?
49+
<span className='rce-button-icon--container'>
50+
{(x.icon.float === 'right' || !x.icon.float) && <a>{x.text}</a>}
5051

51-
<span style={{ float: x.icon.float, color: x.icon.color, fontSize: x.icon.size || 12 }} className={classNames('rce-button-icon', x.icon.className)}>{x.icon.component}</span>
52+
<span style={{ float: x.icon.float, color: x.icon.color, fontSize: x.icon.size || 12 }} className={classNames('rce-button-icon', x.icon.className)}>{x.icon.component}</span>
5253

53-
{x.icon.float === 'left' && <a>{x.text}</a>}
54-
</span>
55-
: <a>{x.text}</a>
54+
{x.icon.float === 'left' && <a>{x.text}</a>}
55+
</span>
56+
: <a>{x.text}</a>
57+
:
58+
<a>{x}</a>
5659
}
5760
</li>
5861
))

0 commit comments

Comments
 (0)