fix: prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement (#5053)

prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
This commit is contained in:
Marcello Fitton 2026-02-26 13:46:01 -08:00 committed by GitHub
parent b13dd820cc
commit 87b81f9d09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,10 @@ export default function useChatContainerQuickScroll() {
if (!modifierPressed || !chatHistoryRef.current) return;
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return;
// Don't hijack cursor movement when a text input is focused
const tag = document.activeElement?.tagName;
if (tag === "TEXTAREA" || tag === "INPUT") return;
switch (event.key) {
case "ArrowUp":
event.preventDefault();