From 0476d065158c33d2020a9f602b3043e5e2f90c75 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Sat, 1 Jan 2022 13:07:52 +0800 Subject: [PATCH] fix: ios text wrapping with 0 width rect (#2786) --- src/css/layout/bounds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/layout/bounds.ts b/src/css/layout/bounds.ts index 43d1bea..2f1c150 100644 --- a/src/css/layout/bounds.ts +++ b/src/css/layout/bounds.ts @@ -17,7 +17,7 @@ export class Bounds { } static fromDOMRectList(context: Context, domRectList: DOMRectList): Bounds { - const domRect = domRectList[0]; + const domRect = Array.from(domRectList).find(rect => rect.width !== 0); return domRect ? new Bounds( domRect.x + context.windowBounds.left,