Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GobalCTB iframe dynamic sizing #18

Merged
merged 3 commits into from
Jun 25, 2024
Merged

GobalCTB iframe dynamic sizing #18

merged 3 commits into from
Jun 25, 2024

Conversation

wpalani
Copy link
Member

@wpalani wpalani commented Jun 24, 2024

Proposed changes

Issue: Some GlobaCTBs are not rendering well withing the modal because they require larger width/height. Since the module can't know or calculate the content of the iframe, it will rely on the source to communicate that information.
More info about this issue: https://jira.newfold.com/browse/PRESS1-406

The source may send a postMessage with type: frameWidth, when the value is received, we'll set the iframe width to that value. Then, the parent can ask the source/iframe to calculate the height and send another postMessage with height value.

We're also refactoring the tests to make them slightly more granular.

Demo

ctb_dynamic-size.mp4

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Internal Ticket: https://jira.newfold.com/browse/PRESS1-406

wpalani added 2 commits June 24, 2024 12:39
The source may send a `postMessage` with `type: frameWidth`. When the value is received, we'll set the iframe width to that value. Then the parent can ask the source/iframe to calculate the height and send another `postMessage` with heights value.
@wpalani wpalani merged commit f27fc58 into main Jun 25, 2024
3 checks passed
@wpalani wpalani deleted the update/dynamic-modal-size branch June 25, 2024 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants