From 9a04316dff84bce8480ec787b178394d70ccb330 Mon Sep 17 00:00:00 2001 From: jrmoulton Date: Thu, 5 Dec 2024 20:15:54 -0700 Subject: [PATCH] fix tab style This fixes an issue that @hydra was experiencing with styling on tabs. It appears that sequential tabs receive the inherited properties of previous tabs. --- src/views/tab.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/tab.rs b/src/views/tab.rs index 6a1eed8c..61201e03 100644 --- a/src/views/tab.rs +++ b/src/views/tab.rs @@ -126,7 +126,9 @@ impl View for Tab { fn style_pass(&mut self, cx: &mut StyleCx<'_>) { for (i, child) in self.id.children().into_iter().enumerate() { - cx.style_view(child); + if i == self.active { + cx.style_view(child); + } let child_view = child.state(); let mut child_view = child_view.borrow_mut(); child_view.combined_style = child_view.combined_style.clone().set(