[PR #5053] [MERGED] fix: prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement #5281

Closed
opened 2026-06-05 15:20:50 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5053
Author: @angelplusultra
Created: 2/23/2026
Status: Merged
Merged: 2/26/2026
Merged by: @timothycarambat

Base: masterHead: 5034-bug-cmdctrlarrowkey-in-chat


📝 Commits (2)

  • 2b2cfba prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement
  • 869479f Merge branch 'master' into 5034-bug-cmdctrlarrowkey-in-chat

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 frontend/src/hooks/useChatContainerQuickScroll.js (+4 -0)

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #5034

Description

The global keyboard shortcut for CMD/CTRL + ArrowUp/Down (scroll chat history to top/bottom) was intercepting the event even when the user was focused on the chat textarea. This prevented the native cursor movement behavior (jump to start/end of text) from working.

This fix checks if the active element is a TEXTAREA or INPUT before handling the scroll shortcut. When a text input is focused, the event is ignored so native cursor behavior is preserved. The scroll shortcut continues to work when no text input is focused.

Visuals (if applicable)

N/A

Additional Information

N/A

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5053 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 2/23/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `5034-bug-cmdctrlarrowkey-in-chat` --- ### 📝 Commits (2) - [`2b2cfba`](https://github.com/Mintplex-Labs/anything-llm/commit/2b2cfba202706bbecaf20133c456f02a6c8e96c9) prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement - [`869479f`](https://github.com/Mintplex-Labs/anything-llm/commit/869479f2fc2ed2f5960e15178589bca9b4fa473e) Merge branch 'master' into 5034-bug-cmdctrlarrowkey-in-chat ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/hooks/useChatContainerQuickScroll.js` (+4 -0) </details> ### 📄 Description ### Pull Request Type - [ ] ✨ feat (New feature) - [x] 🐛 fix (Bug fix) - [ ] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues resolves #5034 ### Description The global keyboard shortcut for CMD/CTRL + ArrowUp/Down (scroll chat history to top/bottom) was intercepting the event even when the user was focused on the chat textarea. This prevented the native cursor movement behavior (jump to start/end of text) from working. This fix checks if the active element is a `TEXTAREA` or `INPUT` before handling the scroll shortcut. When a text input is focused, the event is ignored so native cursor behavior is preserved. The scroll shortcut continues to work when no text input is focused. ### Visuals (if applicable) N/A ### Additional Information N/A ### Developer Validations - [x] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated (if applicable) - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:20:50 -04:00
yindo closed this issue 2026-06-05 15:20:50 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5281