!44162 fix appfreeze when menu use onMeasureSize

Merge pull request !44162 from 0xjackmed/cherry-pick-1726915478
This commit is contained in:
openharmony_ci 2024-09-27 10:45:57 +00:00 committed by Gitee
commit 3f6645d5ff
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 0 deletions

View File

@ -728,6 +728,10 @@ uint32_t MenuPattern::GetInnerMenuCount() const
// found component <Menu>
if (child->GetTag() == V2::JS_VIEW_ETS_TAG) {
child = child->GetFrameChildByIndex(0, false);
if (child && child->GetTag() == V2::JS_VIEW_ETS_TAG) {
child = child->GetChildAtIndex(0);
++depth;
}
continue;
}
if (child->GetTag() == V2::MENU_ETS_TAG) {
@ -755,6 +759,10 @@ RefPtr<FrameNode> MenuPattern::GetFirstInnerMenu() const
// found component <Menu>
if (child->GetTag() == V2::JS_VIEW_ETS_TAG) {
child = child->GetFrameChildByIndex(0, false);
if (child && child->GetTag() == V2::JS_VIEW_ETS_TAG) {
child = child->GetChildAtIndex(0);
++depth;
}
continue;
}
if (child->GetTag() == V2::MENU_ETS_TAG) {

View File

@ -675,6 +675,7 @@ RefPtr<FrameNode> MenuWrapperPattern::GetMenuChild(const RefPtr<UINode>& node)
while (child) {
if (child->GetTag() == V2::JS_VIEW_ETS_TAG) {
auto customNode = DynamicCast<CustomNode>(child);
CHECK_NULL_RETURN(customNode, nullptr);
customNode->Render();
} else if (child->GetTag() == V2::MENU_ETS_TAG) {
menuChild = DynamicCast<FrameNode>(child);