Skip to content

Commit 0b903f4

Browse files
mtrezzadrew-gross
authored andcommitted
added cancellation of editing in data browser by pressing ESC button (#347)
1 parent d716a79 commit 0b903f4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/dashboard/Data/Browser/DataBrowser.react.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,16 @@ export default class DataBrowser extends React.Component {
106106
return;
107107
}
108108
if (this.state.editing) {
109-
return;
109+
switch (e.keyCode) {
110+
case 27: // ESC
111+
this.setState({
112+
editing: false
113+
});
114+
e.preventDefault();
115+
break;
116+
default:
117+
return;
118+
}
110119
}
111120
if (!this.state.current) {
112121
return;

0 commit comments

Comments
 (0)