Widget not implemented?
haydenflinner opened this issue ยท 4 comments
haydenflinner commented
Anyone have any idea how to fix this?
error[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: Widget` is not satisfied
--> src\components\text_entry.rs:43:21
|
43 | f.render_widget(tw, rect);
| ------------- ^^ the trait `Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `Widget`:
BarChart<'a>
Canvas<'a, F>
Chart<'a>
Gauge<'a>
LineGauge<'a>
List<'a>
Paragraph<'a>
Sparkline<'a>
and 7 others
note: required by a bound in `ratatui::Frame::<'a, B>::render_widget`
--> C:\Users\haydu\.cargo\registry\src\github.com-1ecc6299db9ec823\ratatui-0.21.0\src\terminal.rs:88:12
|
86 | pub fn render_widget<W>(&mut self, widget: W, area: Rect)
| ------------- required by a bound in this associated function
87 | where
88 | W: Widget,
| ^^^^^^ required by this bound in `Frame::<'a, B>::render_widget`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `wd` (lib) due to previous error
haydenflinner commented
This turned out to be because Cargo was downloading 0.20.1 of ratatui for tui-textarea, while I was using 0.21.0. Fixed by forking and updating the toml file. Don't think my change to return concrete type was necessary.
main...haydenflinner:tui-textarea:main
danielo515 commented
@haydenflinner thank you for your fork. Using it works for now.
TheAwiteb commented
You can use ratatui-textarea a fully supported tui-textarea
for ratatui
rhysd commented
Closed due to v0.2.1: https://github.com/rhysd/tui-textarea/releases/tag/v0.2.1