Skip to content

Commit

Permalink
Merge pull request #26 from skomputer/delete-hotkey-fix
Browse files Browse the repository at this point in the history
Adds delete and backspace key to list of "remove selection" hotkeys
  • Loading branch information
skomputer committed May 13, 2016
2 parents 0775d58 + aa663d0 commit 0fba366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/components/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Root extends Component {
'resetZoom': 'ctrl+0',
'shiftDown': { sequence: 'shift', action: 'keydown' },
'shiftUp': { sequence: 'shift', action: 'keyup' },
'delete': ['alt+d', 'ctrl+d', 'command+d']
'delete': ['alt+d', 'ctrl+d', 'command+d', 'del', 'backspace']
};

const keyHandlers = {
Expand All @@ -73,7 +73,10 @@ class Root extends Component {
'resetZoom': () => dispatch(resetZoom()),
'shiftDown': () => this.setState({ shiftKey: true }),
'shiftUp': () => this.setState({ shiftKey: false }),
'delete': () => dispatch(deleteSelection(selection))
'delete': (event) => {
event.preventDefault();
dispatch(deleteSelection(selection));
}
};

let graphApi = {
Expand Down
2 changes: 2 additions & 0 deletions app/components/__tests__/Node-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { shallow } from "enzyme";
import Node from '../Node';
import NodeCircle from "../NodeCircle";
import NodeLabel from "../NodeLabel";
import TestUtils from 'react-addons-test-utils';


describe("Node Component", () => {

Expand Down

0 comments on commit 0fba366

Please sign in to comment.