From f16c6cb8b042270af7d15b06fd0b17216785a29b Mon Sep 17 00:00:00 2001 From: zealotchen Date: Mon, 21 Oct 2024 19:22:31 +0800 Subject: [PATCH] fix(web): fix webrender listview item relayout --- .../js/packages/hippy-web-renderer/src/component/list-view.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver/js/packages/hippy-web-renderer/src/component/list-view.ts b/driver/js/packages/hippy-web-renderer/src/component/list-view.ts index 68297a7716a..22b87413956 100644 --- a/driver/js/packages/hippy-web-renderer/src/component/list-view.ts +++ b/driver/js/packages/hippy-web-renderer/src/component/list-view.ts @@ -570,7 +570,8 @@ export class ListViewItem extends HippyWebView { public handleReLayout(entries: ResizeObserverEntry[]) { const [entry] = entries; const { height } = entry.contentRect; - if ((height === 0 && Math.round(height) !== this.height) || Math.round(height) !== this.dom?.clientHeight) { + if ((Math.round(height) === this.height) && Math.round(height) === this.dom?.clientHeight) { + // no need to relayout ListViewItem when height is not changed return; } this.height = Math.round(height);