From 910ce284a202d7d37801b61ac9c4564ee3ae476c Mon Sep 17 00:00:00 2001 From: handlerug Date: Tue, 25 Nov 2025 16:41:53 +0100 Subject: [PATCH] components/switcher-form: listen to keydown events instead of keyup This reduces perceived input delay and allows key repeat to occur. Co-authored-by: handlerug Co-committed-by: handlerug --- components/switcher-form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/switcher-form.js b/components/switcher-form.js index d1b706c..e97a1b6 100644 --- a/components/switcher-form.js +++ b/components/switcher-form.js @@ -65,7 +65,7 @@ export default class SwitcherForm extends Component { this.handleInput = this.handleInput.bind(this); this.handleSubmit = this.handleSubmit.bind(this); - this.handleKeyUp = this.handleKeyUp.bind(this); + this.handleKeyDown = this.handleKeyDown.bind(this); } getSuggestions() { @@ -106,7 +106,7 @@ export default class SwitcherForm extends Component { this.props.onSubmit(this.getSuggestions()[this.state.selected]); } - handleKeyUp(event) { + handleKeyDown(event) { switch (event.key) { case "ArrowUp": event.stopPropagation(); @@ -152,7 +152,7 @@ export default class SwitcherForm extends Component {