If you read the docs on events: Bindings — Phoenix LiveView v0.20.1
You’ll come across this recommendation:
Unless held-down keys are required, a better approach is generally to use phx-keyup bindings which only trigger on key up, thereby being self-limiting. However, phx-keydown is useful for games and other use cases where a constant press on a key is desired. In such cases, throttle should always be used.
A better experience would be a third option that dispatches events immediately on keydown, but would not repeat whatsoever. It sounds like the throttle feature can kind of be used to accomplish this if you set a high value:
A phx-keydown binding is only throttled for key repeats. Unique keypresses back-to-back will dispatch the pressed key events.
But I don’t think that’s really a great option. A dedicated keypress event would be best.