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

fix: add custom resize event #44

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

henriettemoe
Copy link
Contributor

@henriettemoe henriettemoe commented Nov 1, 2023

EDIT: after the merge of #42 this problem does not seem to be an big issue anymore. It is now a 0.97 px difference between the actual height and the iframe height atm.

Need to trigger resize after breakpoints have been applied. In the case where you have multiple categories the iframe is resized before the breakpoint css is applied, therefore the the content is taller than the iframe.

Screenshot from before the change:
Skjermbilde 2023-11-01 kl  10 21 54

Screenshot from after the change:
Skjermbilde 2023-11-01 kl  10 23 03

@henriettemoe henriettemoe marked this pull request as ready for review November 1, 2023 10:39
requestAnimationFrame(() => {
// Trigger custom event instead of H5P event to avoid
// triggering resize until breakpoints have been applied.
context.trigger('resizecontenttype');
Copy link
Contributor

Choose a reason for hiding this comment

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

We could even do context.resize() and avoid the custom event. Not sure what is more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Edit: no it didn't work as it was not possible to drag arguments

Copy link
Contributor

Choose a reason for hiding this comment

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

That's weird. Does it work to drag arguments with the current changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@henriettemoe henriettemoe marked this pull request as draft November 7, 2023 13: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