diff --git a/frameworks/core/components_ng/base/view_abstract_model_ng.cpp b/frameworks/core/components_ng/base/view_abstract_model_ng.cpp index cd39eacd3aaa6500d7febff4ba5811e996444c39..59ed28b561803ba7a1846c7412e8433dd55ec9ab 100644 --- a/frameworks/core/components_ng/base/view_abstract_model_ng.cpp +++ b/frameworks/core/components_ng/base/view_abstract_model_ng.cpp @@ -474,11 +474,20 @@ void ViewAbstractModelNG::BindSheet(bool isShow, std::functionGetMainFrameNode()); CHECK_NULL_VOID(targetNode); + auto themeId = targetNode->GetThemeScopeId(); auto instanceId = sheetStyle.instanceId.has_value() ? sheetStyle.instanceId.value() : Container::CurrentId(); - auto buildNodeFunc = [buildFunc, instanceId]() -> RefPtr { + auto buildNodeFunc = [buildFunc, instanceId, themeId]() -> RefPtr { NG::ScopedViewStackProcessor builderViewStackProcess(instanceId); buildFunc(); auto customNode = NG::ViewStackProcessor::GetInstance()->Finish(); + auto theme = customNode->GetThemeScopeId(); + if (!theme) { + // Update only if not set another value + customNode->AllowUseParentTheme(false); + customNode->UpdateThemeScopeId(themeId); + customNode->UpdateThemeScopeUpdate(themeId); + auto upd = customNode->GetThemeScopeId(); + } return customNode; }; auto buildTitleNodeFunc = [titleBuildFunc, instanceId]() -> RefPtr {