fix(svelte): History suggestions should show immediately when clicking the history button (#63335)

Fixes srch-545

We are hiding suggestions until the user has interacted with the input
(e.g. by clicking or typing), but, as it is not, it does not include
clicking on the history button.

This commit changes that.


## Test plan

Manual testing. Clicking the history button without having interacted
with the search input in any other way will now show history suggestions
and focus in the input.
This commit is contained in:
Felix Kling 2024-06-19 13:54:46 +02:00 committed by GitHub
parent 4638ab87d4
commit 399525b716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -225,6 +225,9 @@
if (editor) {
setMode(editor, currentMode => (currentMode === 'History' ? null : 'History'))
editor.focus()
// This ensures that history suggestions are shown after the button was pressed,
// before the user has interacted with the input in any other way.
userHasInteracted = true
}
}
</script>