Skip to content

Commit c82df85

Browse files
committed
Increase click area of arrows for changing day/month/year
Instead of having the click hander on the span element, it's now attached to the parent th element. This aligns better with the CSS and improves the usability of the component.
1 parent be31e26 commit c82df85

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/DaysView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var DateTimePickerDays = onClickOutside( createClass({
1818
tableChildren = [
1919
DOM.thead({ key: 'th' }, [
2020
DOM.tr({ key: 'h' }, [
21-
DOM.th({ key: 'p', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 1, 'months' )}, '‹' )),
21+
DOM.th({ key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, DOM.span({}, '‹' )),
2222
DOM.th({ key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),
23-
DOM.th({ key: 'n', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 1, 'months' )}, '›' ))
23+
DOM.th({ key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, DOM.span({}, '›' ))
2424
]),
2525
DOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return DOM.th({ key: day + index, className: 'dow'}, day ); }) )
2626
]),

src/MonthsView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ var DateTimePickerMonths = onClickOutside( createClass({
1010
render: function() {
1111
return DOM.div({ className: 'rdtMonths' }, [
1212
DOM.table({ key: 'a' }, DOM.thead( {}, DOM.tr( {}, [
13-
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 1, 'years' )}, '‹' )),
13+
DOM.th({ key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, DOM.span({}, '‹' )),
1414
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ),
15-
DOM.th({ key: 'next', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 1, 'years' )}, '›' ))
15+
DOM.th({ key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, DOM.span({}, '›' ))
1616
]))),
1717
DOM.table({ key: 'months' }, DOM.tbody({ key: 'b' }, this.renderMonths()))
1818
]);

src/YearsView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ var DateTimePickerYears = onClickOutside( createClass({
1212

1313
return DOM.div({ className: 'rdtYears' }, [
1414
DOM.table({ key: 'a' }, DOM.thead({}, DOM.tr({}, [
15-
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 10, 'years' )}, '‹' )),
15+
DOM.th({ key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, DOM.span({}, '‹' )),
1616
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ),
17-
DOM.th({ key: 'next', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 10, 'years' )}, '›' ))
17+
DOM.th({ key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, DOM.span({}, '›' ))
1818
]))),
1919
DOM.table({ key: 'years' }, DOM.tbody( {}, this.renderYears( year )))
2020
]);

0 commit comments

Comments
 (0)