Skip to content

Instantly share code, notes, and snippets.

@MRobertEvers
Created March 24, 2022 17:11
Show Gist options
  • Save MRobertEvers/ff9370150af6bf21663641b730b0424c to your computer and use it in GitHub Desktop.
Save MRobertEvers/ff9370150af6bf21663641b730b0424c to your computer and use it in GitHub Desktop.
IFrames In Modals

Careful when putting IFrames in modals. If the modal is otherwise invisible and has pointer-events: none, the iframe will still capture events. The Iframe is capturing pointer events even though a parent div has "pointer-events: none"...

Chromium says that this works as intended 12:00 https://bugs.chromium.org/p/chromium/issues/detail?id=451929 12:01 "Iframes" aren't the target of tap/touch events, so 'pointer-events: none' doesn't apply to them. Then I guess Mozilla disagrees or this is a bug in Firefox? TIL

@MRobertEvers
Copy link
Author

Use visibility: hidden to prevent touch events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment