fix: do not unset the block on render

This commit is contained in:
EdJoPaTo
2022-11-06 13:37:10 +01:00
parent a902bce55d
commit 982125508c
+2 -2
View File
@@ -317,11 +317,11 @@ impl<'a> StatefulWidget for Tree<'a> {
type State = TreeState;
#[allow(clippy::too_many_lines)]
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
buf.set_style(area, self.style);
// Get the inner area inside a possible block, otherwise use the full area
let area = self.block.take().map_or(area, |b| {
let area = self.block.map_or(area, |b| {
let inner_area = b.inner(area);
b.render(area, buf);
inner_area