From f3fb413a03f49f7b713d62428a2063ff3e7ad80e Mon Sep 17 00:00:00 2001 From: ddifiore <89548500+ddifiore@users.noreply.github.com> Date: Sun, 29 Aug 2021 20:43:07 -0400 Subject: [PATCH] Update view.jsx Trying to action this issue: Pressing escape in wunderbar should do something useful #2116, I also added ctrl-K as a keyboard shortcut to bring the wunderbar into focus. --- ui/component/wunderbarSuggestions/view.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/component/wunderbarSuggestions/view.jsx b/ui/component/wunderbarSuggestions/view.jsx index 14210a42b..8dc069425 100644 --- a/ui/component/wunderbarSuggestions/view.jsx +++ b/ui/component/wunderbarSuggestions/view.jsx @@ -228,12 +228,19 @@ export default function WunderBarSuggestions(props: Props) { function handleKeyDown(event) { const { ctrlKey, metaKey, keyCode } = event; + if (keyCode === K_KEY_CODE && ctrlKey) { + inputRef.current.focus(); + inputRef.current.select(); + return; + } + if (!inputRef.current) { return; } if (inputRef.current === document.activeElement && keyCode === ESC_KEY_CODE) { - inputRef.current.blur(); + inputRef.current.value = ""; + inputRef.current.focus(); } // @if TARGET='app'