Skip to content

Commit

Permalink
Merge pull request #99 from fraserxu/master
Browse files Browse the repository at this point in the history
add unique key prop to child in an array for dialog component
  • Loading branch information
hai-cea committed Nov 29, 2014
2 parents 6d40406 + 712a440 commit b8f3af5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ var Dialog = React.createClass({

render: function() {
var mainClasses = this.getClasses('dialog', { 'show': this.state.open }),
actions = this.props.actions.map(function(a) {
if (a.onClick) return <div className="action" onClick={a.onClick}>{a.text}</div>;
return <div className="action" onClick={this.dismiss}>{a.text}</div>;
actions = this.props.actions.map(function(a, index) {
if (a.onClick) return <div className="action" key={index} onClick={a.onClick}>{a.text}</div>;
return <div className="action" key={index} onClick={this.dismiss}>{a.text}</div>;
}.bind(this));

return (
Expand Down Expand Up @@ -81,7 +81,7 @@ var Dialog = React.createClass({

_handleClickAway: function() {
this.dismiss();
},
},

_checkEscapeKeyUp: function(e) {
if (e.keyCode == KeyCode.ESC) {
Expand Down

0 comments on commit b8f3af5

Please sign in to comment.