Merge branch 'master' into multiple-sites

* master:
  Use arrows (without alt) to go through date ranges
This commit is contained in:
Danny van Kooten 2018-10-05 08:56:56 +02:00
commit 5abd1a7a8a
2 changed files with 6 additions and 4 deletions

View File

@ -162,7 +162,9 @@ class DatePicker extends Component {
@bind
handleKeyPress(evt) {
if( ! evt.altKey ) {
// Don't handle input when the user is in a text field or text area.
let tag = event.target.tagName;
if(tag === "INPUT" || tag === "TEXTAREA") {
return;
}
@ -171,14 +173,14 @@ class DatePicker extends Component {
let newStartDate, newEndDate;
switch(evt.keyCode) {
// ALT + left-arrow
// left-arrow
case 37:
newStartDate = new Date(+this.state.startDate - diff)
newEndDate = new Date(+this.state.endDate - diff)
this.setDateRange(newStartDate, newEndDate)
break;
// ALT + right-arrow
//right-arrow
case 39:
newStartDate = new Date(+this.state.startDate + diff)
newEndDate = new Date(+this.state.endDate + diff)

View File

@ -138,7 +138,7 @@ class Dashboard extends Component {
</div>
<div class="footer hide-on-mobile">
<p>Use <strong>ALT + arrow-key</strong> to cycle through date ranges.</p>
<p>Use <strong>the arrow keys</strong> to cycle through date ranges.</p>
</div>
</section>