Skip to content

Commit fdb4d42

Browse files
committed
Add comment about returnFocus
1 parent b743062 commit fdb4d42

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ 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.
246251
returnFocus={false}
247252
>
248253
<ListContainer

0 commit comments

Comments
 (0)