Skip to content

fix(textinput): render placeholders without null bytes#990

Open
Yongcheng123 wants to merge 1 commit into
charmbracelet:mainfrom
Yongcheng123:fix/textinput-placeholder-rendering
Open

fix(textinput): render placeholders without null bytes#990
Yongcheng123 wants to merge 1 commit into
charmbracelet:mainfrom
Yongcheng123:fix/textinput-placeholder-rendering

Conversation

@Yongcheng123
Copy link
Copy Markdown

Summary

  • make placeholder rendering grapheme-aware instead of copying into a zero-filled rune buffer
  • truncate placeholder text with ansi.Truncate and pad the remaining width without emitting null bytes
  • re-enable and tighten placeholder regression tests, including an emoji placeholder case

Testing

  • go test ./textinput
  • go test ./...
  • go vet ./...

Closes #573

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.

Emojis don't render as placeholders in textarea and textinput

1 participant