!48622 revert  47085

Merge pull request !48622 from Zhang Jinyu/dialog_1115
This commit is contained in:
openharmony_ci 2024-11-16 06:32:52 +00:00 committed by Gitee
commit d5340ddc95
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -583,21 +583,10 @@ void DialogLayoutAlgorithm::ParseSubwindowId(const RefPtr<DialogLayoutProperty>&
void DialogLayoutAlgorithm::AdjustHeightForKeyboard(LayoutWrapper* layoutWrapper, const RefPtr<LayoutWrapper>& child)
{
if (Container::LessThanAPITargetVersion(PlatformVersion::VERSION_TWELVE) || !child ||
if (Container::LessThanAPITargetVersion(PlatformVersion::VERSION_TWELVE) || !child || !resizeFlag_ ||
keyboardAvoidMode_ == KeyboardAvoidMode::NONE) {
return;
}
auto host = child->GetHostNode();
CHECK_NULL_VOID(host);
auto renderContext = host->GetRenderContext();
CHECK_NULL_VOID(renderContext);
if (!resizeFlag_) {
auto clipEdge = renderContext->GetClipEdge().value_or(false);
if (clipEdge) {
renderContext->UpdateClipEdge(false);
}
return;
}
auto childLayoutProperty = child->GetLayoutProperty();
auto dialogProp = DynamicCast<DialogLayoutProperty>(layoutWrapper->GetLayoutProperty());
CHECK_NULL_VOID(childLayoutProperty);
@ -614,6 +603,8 @@ void DialogLayoutAlgorithm::AdjustHeightForKeyboard(LayoutWrapper* layoutWrapper
}
child->Measure(childConstraint);
child->GetGeometryNode()->SetFrameSize(dialogChildSize_);
auto renderContext = child->GetHostNode()->GetRenderContext();
CHECK_NULL_VOID(renderContext);
renderContext->SetClipToFrame(true);
renderContext->UpdateClipEdge(true);
}