Skip to content

Commit

Permalink
Fix forward slash key listen for typing on another contentEditable div
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Nov 27, 2016
1 parent 6b130e0 commit a1e86e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/SearchPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class SearchPane extends React.Component {
onDocumentKeyDown(e) {
if (e.keyCode === 191) { // forward slash
var doc = ReactDOM.findDOMNode(this).ownerDocument;
if (!this.input || doc.activeElement.nodeName === 'INPUT') {
var el = doc.activeElement;
if (
!this.input ||
el.nodeName === 'INPUT' ||
el.nodeName === 'DIV' && el.contentEditable
) {
return;
}
this.input.focus();
Expand Down

0 comments on commit a1e86e4

Please sign in to comment.