Skip to content

Commit

Permalink
fix(core): 🐛 Fix TextStyle cause providers mismatched
Browse files Browse the repository at this point in the history
  • Loading branch information
wjian23 committed Dec 16, 2024
1 parent d5eec2b commit ca23645
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Please only add new entries below the [Unreleased](#unreleased---releasedate) he

- **core**: fix mismatch of providers. (#669 @wjian23)
- **core**: Added DeclarerWithSubscription to let Widget `Expanded` accept pipe value. (#669 @wjian23)
- **core**: fix set opacity zero no work to it's children. (#pr @wjian23)
- **core**: Fix setting opacity to zero not applying to child elements (#pr @wjian23)
- **core**: Fix TextStyle cause providers mismatched (#pr @wjian23)

## [0.4.0-alpha.18] - 2024-12-11

Expand Down
9 changes: 3 additions & 6 deletions core/src/builtin_widgets/text_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ impl<'c> ComposeChild<'c> for TextStyleWidget {
}
};

let ctx = BuildCtx::get_mut();
ctx.current_providers.push(provider);
child.into_widget().on_build(|id| {
let provider = ctx.current_providers.pop().unwrap();
id.attach_data(provider, ctx.tree_mut());
})
Provider::new(provider)
.with_child(fn_widget! { child })
.into_widget()
}
}

Expand Down

0 comments on commit ca23645

Please sign in to comment.