mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
parent
c9b95fa728
commit
181bee780a
@ -162,7 +162,9 @@ class DatePicker extends Component {
|
|||||||
|
|
||||||
@bind
|
@bind
|
||||||
handleKeyPress(evt) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,14 +173,14 @@ class DatePicker extends Component {
|
|||||||
let newStartDate, newEndDate;
|
let newStartDate, newEndDate;
|
||||||
|
|
||||||
switch(evt.keyCode) {
|
switch(evt.keyCode) {
|
||||||
// ALT + left-arrow
|
// left-arrow
|
||||||
case 37:
|
case 37:
|
||||||
newStartDate = new Date(+this.state.startDate - diff)
|
newStartDate = new Date(+this.state.startDate - diff)
|
||||||
newEndDate = new Date(+this.state.endDate - diff)
|
newEndDate = new Date(+this.state.endDate - diff)
|
||||||
this.setDateRange(newStartDate, newEndDate)
|
this.setDateRange(newStartDate, newEndDate)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ALT + right-arrow
|
//right-arrow
|
||||||
case 39:
|
case 39:
|
||||||
newStartDate = new Date(+this.state.startDate + diff)
|
newStartDate = new Date(+this.state.startDate + diff)
|
||||||
newEndDate = new Date(+this.state.endDate + diff)
|
newEndDate = new Date(+this.state.endDate + diff)
|
||||||
|
@ -69,7 +69,7 @@ class Dashboard extends Component {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer hide-on-mobile">
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user