Skip to content

Commit

Permalink
Merge pull request #122 from gaearon/prevent
Browse files Browse the repository at this point in the history
Prevent default on all key navigations
  • Loading branch information
bvaughn authored Apr 10, 2019
2 parents 4b0424f + 5b480a8 commit 88e51ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/devtools/views/Components/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ export default function Tree(props: Props) {
// eslint-disable-next-line default-case
switch (event.key) {
case 'ArrowDown':
selectNextElementInTree();
event.preventDefault();
selectNextElementInTree();
break;
case 'ArrowLeft':
event.preventDefault();
element =
selectedElementID !== null
? store.getElementByID(selectedElementID)
Expand All @@ -109,6 +110,7 @@ export default function Tree(props: Props) {
}
break;
case 'ArrowRight':
event.preventDefault();
element =
selectedElementID !== null
? store.getElementByID(selectedElementID)
Expand All @@ -122,11 +124,10 @@ export default function Tree(props: Props) {
} else {
selectNextElementInTree();
}
event.preventDefault();
break;
case 'ArrowUp':
selectPreviousElementInTree();
event.preventDefault();
selectPreviousElementInTree();
break;
}
};
Expand Down

0 comments on commit 88e51ad

Please sign in to comment.