Skip to content

Conversation

@zerone0x
Copy link
Contributor

What does this PR do?

Fixes the textarea cursor not auto-scrolling when typing long prompts that exceed the visible area (maxHeight of 6 lines).

When typing beyond the visible area, the cursor would move but the viewport wouldn't follow, leaving the text invisible and causing black/empty spaces to appear.

How did you verify your code works?

The fix adds markDirty() and requestRender() calls to the onContentChange handler, matching the pattern already used in:

  • onPaste handler (lines 926-929)
  • TuiEvent.PromptAppend handler (lines 98-100)

This ensures the layout is recalculated and the viewport syncs with cursor position on every keystroke.


Fixes #10401

🤖 Generated with Claude Code

Add markDirty() and requestRender() calls to the onContentChange handler
to keep the cursor visible when typing beyond the visible area.

This matches the pattern already used in the onPaste and
TuiEvent.PromptAppend handlers.

Fixes anomalyco#10401

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found a potentially related PR:

PR #10449: fix(tui): resolve textarea flickering when pasting long text in question prompt
#10449

Why it's related: Both PRs address textarea rendering issues in the TUI. PR #10449 fixes flickering when pasting long text, while PR #10482 fixes cursor auto-scrolling when typing long prompts. Both likely involve similar viewport/layout recalculation mechanisms (markDirty() and requestRender() patterns) for the textarea component.

You may want to check if these can be combined or if they address different aspects of the same component issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Textarea cursor doesn't auto-scroll when typing long prompts

1 participant