From b6493a84c9b96d946d9b38b6aaf48dfa7d35e925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20D=C3=B6rr?= Date: Fri, 17 Jun 2016 16:01:35 +0200 Subject: [PATCH] Added onDayFocus prop --- src/Day.js | 3 +++ src/DayPicker.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Day.js b/src/Day.js index d31726876f..77f9b7f4da 100644 --- a/src/Day.js +++ b/src/Day.js @@ -22,6 +22,7 @@ export default function Day({ onKeyDown, onTouchStart, onTouchEnd, + onFocus, ariaLabel, ariaDisabled, ariaSelected, @@ -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} @@ -67,6 +69,7 @@ Day.propTypes = { onMouseLeave: PropTypes.func, onTouchEnd: PropTypes.func, onTouchStart: PropTypes.func, + onFocus: PropTypes.func, tabIndex: PropTypes.number, }; diff --git a/src/DayPicker.js b/src/DayPicker.js index 06fa520ebe..c42358def3 100644 --- a/src/DayPicker.js +++ b/src/DayPicker.js @@ -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, @@ -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)}