fix: arrow keys should navigate cursor when user has typed input #58

Closed
opened 2026-01-23 12:32:46 -08:00 by naomi · 0 comments
Owner

Current Behaviour

The up and down arrow keys always navigate through chat history, regardless of whether the user has typed something in the input field.

Expected Behaviour

  • If the user has NOT typed anything: Arrow keys navigate chat history (current behaviour)
  • If the user HAS typed something: Arrow keys should move the cursor within the text input instead

Implementation Notes

Since the text input gets filled when navigating history, we can't simply check if the input is empty. We need to explicitly track whether the user has typed something themselves vs. the input being populated by history navigation.

Suggested approach:

  • Add a flag like userHasTyped that tracks manual input
  • Set it to true on input events (but not when we programmatically set the value from history)
  • Reset it to false when the message is sent or input is cleared
  • Only intercept arrow keys for history navigation when userHasTyped is false

This issue was created with help from Hikari~ 🌸

## Current Behaviour The up and down arrow keys always navigate through chat history, regardless of whether the user has typed something in the input field. ## Expected Behaviour - **If the user has NOT typed anything**: Arrow keys navigate chat history (current behaviour) - **If the user HAS typed something**: Arrow keys should move the cursor within the text input instead ## Implementation Notes Since the text input gets filled when navigating history, we can't simply check if the input is empty. We need to explicitly track whether the user has typed something themselves vs. the input being populated by history navigation. Suggested approach: - Add a flag like `userHasTyped` that tracks manual input - Set it to `true` on `input` events (but not when we programmatically set the value from history) - Reset it to `false` when the message is sent or input is cleared - Only intercept arrow keys for history navigation when `userHasTyped` is `false` --- ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-01-24 12:45:17 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#58