Skip to content

fix(textinput): show full placeholder when width is unset#982

Open
leno23 wants to merge 1 commit into
charmbracelet:mainfrom
leno23:fix/textinput-placeholder-zero-width-779
Open

fix(textinput): show full placeholder when width is unset#982
leno23 wants to merge 1 commit into
charmbracelet:mainfrom
leno23:fix/textinput-placeholder-zero-width-779

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • When SetWidth is not called (width 0), placeholderView now allocates enough space for the full placeholder instead of a single rune
  • Fixes the bug where only the first character of the placeholder was shown on initial render

Fixes #779

Also addresses #950 (0 width breaks placeholders).

Test plan

  • go test ./textinput/...
  • Added TestPlaceholderZeroWidth

Made with Cursor

Allocate enough runes for the full placeholder before copying so width 0
no longer truncates to the first character. Fixes charmbracelet#779

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

textinput: Initial letter only shown in placeholder

1 participant