diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0696a87..62bcd6916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/core/src/builtin_widgets/text_style.rs b/core/src/builtin_widgets/text_style.rs index 4a395936b..6549df2f8 100644 --- a/core/src/builtin_widgets/text_style.rs +++ b/core/src/builtin_widgets/text_style.rs @@ -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() } }