From 0407840e8b15c0c9e45122234000a9d20dd10e23 Mon Sep 17 00:00:00 2001 From: 18168667290 Date: Sat, 9 Nov 2024 14:47:11 +0800 Subject: [PATCH] fix menu show in subwindow error Signed-off-by: 18168667290 --- frameworks/core/components_ng/base/view_abstract.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/frameworks/core/components_ng/base/view_abstract.cpp b/frameworks/core/components_ng/base/view_abstract.cpp index 6f8e777e27e..18afe2c2ac6 100644 --- a/frameworks/core/components_ng/base/view_abstract.cpp +++ b/frameworks/core/components_ng/base/view_abstract.cpp @@ -1943,15 +1943,8 @@ void ViewAbstract::BindMenuWithCustomNode(std::function&& buildFunc, con } if (menuParam.type == MenuType::MENU && expandDisplay && menuParam.isShowInSubWindow && targetNode->GetTag() != V2::SELECT_ETS_TAG) { - bool isShown = SubwindowManager::GetInstance()->GetShown(); - if (!isShown) { - SubwindowManager::GetInstance()->ShowMenuNG( - std::move(buildFunc), std::move(previewBuildFunc), menuParam, targetNode, offset); - } else { - auto menuNode = overlayManager->GetMenuNode(targetNode->GetId()); - TAG_LOGI(AceLogTag::ACE_MENU, "will hide menu, tagetNode id %{public}d.", targetNode->GetId()); - SubwindowManager::GetInstance()->HideMenuNG(menuNode, targetNode->GetId()); - } + SubwindowManager::GetInstance()->ShowMenuNG( + std::move(buildFunc), std::move(previewBuildFunc), menuParam, targetNode, offset); return; } NG::ScopedViewStackProcessor builderViewStackProcessor;