Skip to content

Commit f2eea40

Browse files
authored
Merge pull request #3322 from github/koesie10/suggest-box-command-palette
Fix not being able to open command palette in suggest box
2 parents 57faebd + fdb4d42 commit f2eea40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extensions/ql-vscode/src/view/common/SuggestBox/SuggestBox.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ export const SuggestBox = <
243243
context={context}
244244
initialFocus={-1}
245245
visuallyHiddenDismiss
246+
// The default for returnFocus is true, but this doesn't work when opening
247+
// the command palette in a VS Code webview. The focus is returned to the
248+
// input element, but this closes the command palette immediately after opening
249+
// it. By setting returnFocus to false, the focus is not immediately given to
250+
// the input element, so the command palette stays open.
251+
returnFocus={false}
246252
>
247253
<ListContainer
248254
{...getFloatingProps({

0 commit comments

Comments
 (0)