Skip to content

Commit

Permalink
Merge pull request #9 from noreiller/master
Browse files Browse the repository at this point in the history
Add the 'type' attribute on buttons to prevent auto-submission if the…
  • Loading branch information
tomkp committed Jan 3, 2017
2 parents d0469ce + 1ff63f7 commit c152bd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Calendar.js
Expand Up @@ -159,13 +159,13 @@ export default React.createClass({
nav = (
<tr className="month-header">
<th className="nav previous">
<button className="nav-inner" onClick={this.previous}>«</button>
<button className="nav-inner" onClick={this.previous} type="button">«</button>
</th>
<th colSpan="5">
<span className="month">{month.format('MMMM')}</span> <span className="year">{month.format('YYYY')}</span>
</th>
<th className="nav next">
<button className="nav-inner" onClick={this.next}>»</button>
<button className="nav-inner" onClick={this.next} type="button">»</button>
</th>
</tr>
)
Expand Down
7 changes: 5 additions & 2 deletions src/Day.js
Expand Up @@ -28,8 +28,11 @@ export default React.createClass({
}
else {
body = (
<button className="Day-inner"
onClick={() => this.props.handleClick(this.props.date)}>
<button
className="Day-inner"
onClick={() => this.props.handleClick(this.props.date)}
type="button"
>
{this.props.date.format('D')}
</button>
)
Expand Down

0 comments on commit c152bd1

Please sign in to comment.