fix select popup component extra reference issue.

Signed-off-by: xuzhidan <xuzhidan1@huawei.com>
Change-Id: I56c3efeaee586a55e9871aa7d33e201ecdfda1f6
This commit is contained in:
xuzhidan
2022-03-18 21:47:04 +08:00
parent 8ee1299da3
commit 8541b89c0f
2 changed files with 6 additions and 1 deletions
@@ -1745,7 +1745,7 @@ void JSViewAbstract::JsBindMenu(const JSCallbackInfo& info)
return;
}
auto showDialog = refPtr->GetTargetCallback();
showDialog("", info.GetGlobalLocation());
showDialog("BindMenu", info.GetGlobalLocation());
});
click->SetOnClick(tapGesture);
auto menuTheme = GetTheme<SelectTheme>();
@@ -90,6 +90,11 @@ void MenuElement::OnTargetCallback(const ComposeId& id, const Offset& point)
}
auto popup = data_->GetPopup();
if (id == "BindMenu") {
popup->ShowDialog(stack, point, point, true);
return;
}
if (id.empty()) {
popup->ShowDialog(stack, point, point, true);
context->SetContextMenu(popup);