From 91fbea13f487110e0136548d391c00516049d432 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 10 Dec 2020 15:14:39 -0600 Subject: [PATCH] fix terminal losing focus after opening context menu Fixes https://github.com/pybricks/support/issues/170 --- src/components/Terminal.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 1a612fed..7bf3558c 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -136,6 +136,11 @@ class Terminal extends React.Component { ); } + + onContextMenuClose = () => { + // without this, the terminal looses focus + this.xterm.focus(); + }; } const mapStateToProps = (state: RootState): StateProps => ({