File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -217,16 +217,16 @@ export const AUTO_HEIGHT_BRIDGE = `(() => {
217217 window.__AUTO_HEIGHT_VISUAL_VIEWPORT_HANDLER__ = handler;
218218 };
219219
220- const attachFontLoadListeners = () => {
221- const fonts = document.fonts ;
222- if (!fonts || !fonts.addEventListener ) {
220+ const attachIframeLoadListeners = () => {
221+ const iframes = document.querySelectorAll('iframe') ;
222+ if (!iframes.length ) {
223223 return;
224224 }
225225
226226 const handler = () => scheduleHeightUpdate();
227- fonts.addEventListener('loadingdone', handler);
228- fonts .addEventListener('loadingerror ', handler);
229- window.__AUTO_HEIGHT_FONT_HANDLER__ = handler;
227+ for (let index = 0; index < iframes.length; index += 1) {
228+ iframes[index] .addEventListener('load ', handler);
229+ }
230230 };
231231
232232 const attachGlobalListeners = () => {
@@ -251,6 +251,8 @@ export const AUTO_HEIGHT_BRIDGE = `(() => {
251251 attachResizeObserver();
252252 attachVisualViewport();
253253 attachFontLoadListeners();
254+ attachImageLoadListeners();
255+ attachIframeLoadListeners();
254256 attachGlobalListeners();
255257 scheduleHeightUpdate();
256258
You can’t perform that action at this time.
0 commit comments