Skip to content

Commit

Permalink
Merge pull request #185 from allbuttonspressed/onDayFocus
Browse files Browse the repository at this point in the history
Added onDayFocus prop
  • Loading branch information
gpbl committed Jun 19, 2016
2 parents e4fa65d + b6493a8 commit b305bc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Day.js
Expand Up @@ -22,6 +22,7 @@ export default function Day({
onKeyDown,
onTouchStart,
onTouchEnd,
onFocus,
ariaLabel,
ariaDisabled,
ariaSelected,
Expand All @@ -46,6 +47,7 @@ export default function Day({
onMouseLeave={handleEvent(onMouseLeave, day, modifiers)}
onTouchEnd={handleEvent(onTouchEnd, day, modifiers)}
onTouchStart={handleEvent(onTouchStart, day, modifiers)}
onFocus={handleEvent(onFocus, day, modifiers)}
>
{children}
</div>
Expand All @@ -67,6 +69,7 @@ Day.propTypes = {
onMouseLeave: PropTypes.func,
onTouchEnd: PropTypes.func,
onTouchStart: PropTypes.func,
onFocus: PropTypes.func,
tabIndex: PropTypes.number,
};

Expand Down
2 changes: 2 additions & 0 deletions src/DayPicker.js
Expand Up @@ -40,6 +40,7 @@ export default class DayPicker extends Component {
onDayMouseLeave: PropTypes.func,
onDayTouchStart: PropTypes.func,
onDayTouchEnd: PropTypes.func,
onDayFocus: PropTypes.func,
onMonthChange: PropTypes.func,
onCaptionClick: PropTypes.func,

Expand Down Expand Up @@ -397,6 +398,7 @@ export default class DayPicker extends Component {
onKeyDown={this.handleDayKeyDown}
onTouchStart={this.props.onDayTouchStart}
onTouchEnd={this.props.onDayTouchEnd}
onFocus={this.props.onDayFocus}
onClick={this.props.onDayClick ? this.handleDayClick : undefined}
>
{this.props.renderDay(day)}
Expand Down

0 comments on commit b305bc3

Please sign in to comment.