Conversation
…sk chat input field-sizing:content misrenders the caret for full-width (CJK) characters in the task chat inputbox. Drop it and sync the textarea height from scrollHeight instead, keeping min-h-8/max-h-36 bounds and overflow scrolling. Closes chaitin#1224
X33834
force-pushed
the
fix/chat-input-cursor-cjk
branch
from
September 29, 2026 19:00
d8200d5 to
e93f25b
Compare
Author
|
友好 ping 一下 🙏 这个修复很小(+14/-1),解决中文输入时光标偏移的问题,方便时帮忙看一眼就好,不急~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #1224
Problem
TaskChatInputBox's textarea uses[field-sizing:content](field-sizing: content). With full-width (CJK) characters the browser misrenders the caret, so the visible cursor drifts ~one full-width char to the right of the real insertion point (worst at line ends / after CJK text).Root cause
field-sizing: contenthas known caret/selection rendering quirks for CJK text in the textarea. Notably, the other two task textareas in this repo already avoid it:create-default-task-dialog.tsxandstart-develop-task-dialog.tsxboth usefield-sizing-fixed.Fix
[field-sizing:content]from the task chat inputbox textarea.textarea.style.heightfromscrollHeightin an effect keyed oncontent(falls back tomin-h-8when empty, capped bymax-h-36+overflow-y-auto).This preserves the auto-resizing UX while eliminating the CJK caret offset.
Verification
eslint src/components/console/task/chat-inputbox.tsx— cleantsc -b— cleanvite build --mode online— succeeds