mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-29 06:06:52 +08:00
fix(android): sticky header not deleted from ControllerManager (#3356)
may crash in vue2 when recreating view with same id Co-authored-by: siguangli <siguangli@qq.com> Co-authored-by: OpenHippy <124017524+open-hippy@users.noreply.github.com>
This commit is contained in:
co-authored by
siguangli
OpenHippy
parent
4af21ac51f
commit
48decb1025
+11
-9
@@ -527,7 +527,7 @@ public class ControllerManager {
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void deleteChildRecursive(int rootId, ViewGroup parent, View child, boolean recyclable) {
|
||||
if (parent == null || child == null) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
HippyViewController childController = null;
|
||||
@@ -555,15 +555,17 @@ public class ControllerManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
String parentTag = NativeViewTag.getClassName(parent);
|
||||
if (parentTag != null) {
|
||||
HippyViewController parentController = mControllerRegistry.getViewController(
|
||||
parentTag);
|
||||
if (parentController != null) {
|
||||
parentController.deleteChild(parent, child);
|
||||
if (parent != null) {
|
||||
String parentTag = NativeViewTag.getClassName(parent);
|
||||
if (parentTag != null) {
|
||||
HippyViewController parentController = mControllerRegistry.getViewController(
|
||||
parentTag);
|
||||
if (parentController != null) {
|
||||
parentController.deleteChild(parent, child);
|
||||
}
|
||||
} else {
|
||||
parent.removeView(child);
|
||||
}
|
||||
} else {
|
||||
parent.removeView(child);
|
||||
}
|
||||
mControllerRegistry.removeView(rootId, child.getId());
|
||||
if (checkRecyclable(childController, recyclable) && childTag != null) {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class ListItemRenderNode extends RenderNode {
|
||||
if (parentNode != null) {
|
||||
mControllerManager.deleteChild(mRootId, parentNode.getId(), mId, true);
|
||||
} else {
|
||||
removeChildrenView(this);
|
||||
mControllerManager.deleteChildRecursive(mRootId, null, getHostView(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user