Skip to content

Commit

Permalink
add the 'type' attribute on buttons to prevent auto-submission if the…
Browse files Browse the repository at this point in the history
… calendar is contained in a form
  • Loading branch information
noreiller committed Jan 3, 2017
1 parent c1b9ba9 commit 1ff63f7
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 1ff63f7

Please sign in to comment.