discourse/public/javascripts
Rafael dos Santos Silva ce3b528204
FIX: Use iframe style.height for embed resize messages (#39321)
## Summary

When Discourse is loaded in full app embed mode with `dynamicHeight:
true`, the iframe was not resizing in production despite
`discourse-resize` messages arriving correctly.

The full app path sets `iframe.style.height` as an inline style for the
initial height. Inline styles always win over the `height` HTML
attribute, so our resize handler — which set `iframe.height = ...` — had
no visible effect.

This changes the resize handler to set `iframe.style.height` so it
actually overrides the inline style. This also works for the standard
(non-full-app) embed path since no inline style is set there initially.

## Test plan

- [ ] Full app embed with `dynamicHeight: true` — verify iframe height
updates as content loads
- [ ] Standard (non-full-app) embed — verify iframe still resizes
correctly
- [ ] CSS `max-height` on the iframe still wins (inline `height` doesn't
override `max-height`)
2026-04-16 15:17:06 -03:00
..
count.js
embed-topics.js FIX: The attribute is discourse-url not data-discourse-url 2020-10-28 17:12:29 -04:00
embed.js FIX: Use iframe style.height for embed resize messages (#39321) 2026-04-16 15:17:06 -03:00
media-optimization-worker.js DEV: System specs for image optimization in composer (#36060) 2025-11-19 11:37:15 +10:00