charmbracelet / bubbles

TUI components for Bubble Tea 🫧
MIT License
5.64k stars 263 forks source link

textarea: sometimes freezes when calling textarea.SetValue() and then textarea.View() #566

Open plutov opened 4 months ago

plutov commented 4 months ago

My Update func shows or hides the textarea depending on app state. Sometimes it works well, but sometimes it hangs on View. Replacing textarea.View with some simple string works well, so the state is correct.

  1. Install and run https://github.com/plutov/ultrafocus
  2. Select "blacklist" from the menu

Source Code Model Update: https://github.com/plutov/ultrafocus/blob/main/cli/model.go#L63 textarea.View: https://github.com/plutov/ultrafocus/blob/main/cli/view.go#L40

Expected behavior Textarea shows/hides properly based on app state.

p.s. When I remove SetValue() call everything works fine with empty textarea.

plutov commented 4 months ago

I resolved this issue by modifying the styles. By default it uses lipgloss.AdaptiveColor which causes the issue.