PostHog / posthog

🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
19.45k stars 1.14k forks source link

Bug report: Surveys - HTML preview allows iframe widths wider than the survey #23459

Open slshults opened 4 days ago

slshults commented 4 days ago

Bug Description

Bug description

HTML entry allows iframe widths that are wider than the survey, kinda broken-looking in the preview (and can't be saved):

image

How to reproduce

  1. Create a survey
  2. Switch to the HTML tab for input
  3. Add an iframe with a width well over 300px (e.g. 3000px) e.g. this iframe seen in the screenshot:
    
    <blockquote>
    Cool!
    </blockquote>

<iframe width="3000" height="315" src="https://www.youtube.com/embed/75Hv0RUFIrQ?si=pb-rL8G170eYcrb6" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen?


4. See the preview
5. Save the Survey
6. Go back into edit mode on the same survey and notice that the `iframe` html is gone, but the `blockquote` remains)

Example survey: https://us.posthog.com/project/52792/surveys/01907a3e-2aed-0000-7620-384b2ee969d4?edit=true

## Additional context
From: https://posthoghelp.zendesk.com/agent/tickets/13081

### Debug info

_No response_