rhysd / tui-textarea

Simple yet powerful multi-line text editor widget for ratatui and tui-rs
https://crates.io/crates/tui-textarea
MIT License
323 stars 61 forks source link

placeholder text support #15

Closed pm100 closed 1 year ago

pm100 commented 1 year ago

in order to cleanly integrate tui-textarea into another tool (gitui https://github.com/extrawurst/gitui) I need this feature.

It is like the html input tag placeholder feature, text is displayed dimmed in the input box as a hint of what to enter. Once text is entered the hint is removed

placeholder

I had to slightly modify how the text and its surrounding block are displayed. it is very tricky to get precise control. over the text style of the paragraph and its containing block otherwise. I placed a link to the discussion about this topic with ratatui team. https://github.com/tui-rs-revival/ratatui/issues/144

I added 2 samples of a popup dialog with the new feature. I also added it to the single_line sample as that seemed a good fit