Skip to content

fix: change embedded H5P resize delay to 1ms#80

Merged
rhell4 merged 1 commit intostable-catalystfrom
embed-resizer-issues
Feb 11, 2026
Merged

fix: change embedded H5P resize delay to 1ms#80
rhell4 merged 1 commit intostable-catalystfrom
embed-resizer-issues

Conversation

@rhell4
Copy link

@rhell4 rhell4 commented Feb 10, 2026

Client noticed some embedded H5P activities were leaving extra white space on the page when it resizes. This was because the iframe height wasn't being adjusted. It seems like a delay of 0ms is too fast for some content types (book is fine but document tool isn't).

Solution: change the delay to 1ms

Testing:

  • Create a H5P activity
  • Content type should be "Document tool"
  • On one page add a few paragraphs of text, a image, etc. to make the content longer
  • On another page add just 1 line of text so it is much smaller than the other page
  • Ensure the "Display action bar and frame" activity setting is on (needed to easily grab the embedded HTML)
  • Save and view the H5P activity
  • Click on embed in the bottom action bar
  • Copy the embed HTML
  • Create a page activity
  • Add the embed HTML to the page contents
  • Save and view the page
  • Move back and forwards between the H5P pages
  • Ensure the whole Moodle page is adjusting to the correct content sizes so that there is no extra empty space

Copy link

@keevan keevan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code wise I see no issue with the changes here. Ideally things that need to happen in a specific order aren't done with timeouts, but sometimes timeouts are the simplest approach.

Happy for this to land as-is.

@rhell4 rhell4 merged commit 75cdc6b into stable-catalyst Feb 11, 2026
14 checks passed
@rhell4 rhell4 deleted the embed-resizer-issues branch February 11, 2026 01:22
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