Skip to content

Commit

Permalink
fix tab style
Browse files Browse the repository at this point in the history
This fixes an issue that @hydra was experiencing
with styling on tabs. It appears that sequential
tabs receive the inherited properties of previous
tabs.
  • Loading branch information
jrmoulton committed Dec 6, 2024
1 parent 439548d commit 9a04316
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ impl<T> View for Tab<T> {

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(
Expand Down

0 comments on commit 9a04316

Please sign in to comment.