Skip to content

Commit c3fac7a

Browse files
fix: defer initial size measurement to ResizeObserver (#143)
1 parent e514e6c commit c3fac7a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/app.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,8 +979,7 @@ export class App extends Protocol<AppRequest, AppNotification, AppResult> {
979979
});
980980
};
981981

982-
sendBodySizeChanged();
983-
982+
// ResizeObserver will fire for initial layout and all subsequent changes
984983
const resizeObserver = new ResizeObserver(sendBodySizeChanged);
985984
// Observe both html and body to catch all size changes
986985
resizeObserver.observe(document.documentElement);

0 commit comments

Comments
 (0)