mirror of
https://github.com/chinchang/web-maker.git
synced 2025-02-22 06:03:22 +01:00
app: close saveditempane on escape key
This commit is contained in:
parent
c5462aab4c
commit
c6708ad034
@ -554,8 +554,14 @@ export default class App extends Component {
|
|||||||
isKeyboardShortcutsModalOpen: !this.state.isKeyboardShortcutsModalOpen
|
isKeyboardShortcutsModalOpen: !this.state.isKeyboardShortcutsModalOpen
|
||||||
});
|
});
|
||||||
trackEvent('ui', 'showKeyboardShortcutsShortcut');
|
trackEvent('ui', 'showKeyboardShortcutsShortcut');
|
||||||
} else if (event.keyCode === 27 && event.target.tagName !== 'INPUT') {
|
} else if (
|
||||||
// We might be listening on keydown for some input inside the app. In that case
|
event.keyCode === 27 &&
|
||||||
|
(event.target.tagName !== 'INPUT' || event.target.id === 'searchInput')
|
||||||
|
) {
|
||||||
|
// ESCAPE
|
||||||
|
// TODO: whats written next doesn't make sense. Review it.
|
||||||
|
// We might be listening on keydown for some input inside the app, UNLESS its
|
||||||
|
// the search input in saved items pane. In that case
|
||||||
// we don't want this to trigger which in turn focuses back the last editor.
|
// we don't want this to trigger which in turn focuses back the last editor.
|
||||||
this.closeSavedItemsPane();
|
this.closeSavedItemsPane();
|
||||||
} else if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
|
} else if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user