Skip to content

Commit

Permalink
Fix a console warning when opening table dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
maksis committed Aug 22, 2016
1 parent 48af9cd commit 97b7411
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/components/semantic/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ const Popup = React.createClass({

this.createPortal();

const children = React.cloneElement(this.props.children, {
hide: this.hide,
});
let { children } = this.props;
if (typeof children.type !== 'string') {
children = React.cloneElement(children, {
hide: this.hide,
});
}

ReactDOM.render(children, this.node);

Expand Down
7 changes: 4 additions & 3 deletions src/components/semantic/TableDropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import invariant from 'invariant';
import classNames from 'classnames';

import Popup from './Popup';

import PureRenderMixin from 'react-addons-pure-render-mixin';
import invariant from 'invariant';
import DropdownCaption from './DropdownCaption';


Expand All @@ -27,7 +29,6 @@ const TableDropdown = React.createClass({
getDefaultProps() {
return {
linkCaption: true,
className: '',
};
},

Expand Down Expand Up @@ -67,7 +68,7 @@ const TableDropdown = React.createClass({
};

return (
<div className={ 'table dropdown ' + this.props.className }>
<div className={ classNames('table dropdown', this.props.className) }>
<Popup
className="basic dropdown-content"
trigger={ trigger }
Expand Down

0 comments on commit 97b7411

Please sign in to comment.