Skip to content

fix: add custom resize event#44

Draft
henriettemoe wants to merge 1 commit into
masterfrom
fix/add-custom-resize-event
Draft

fix: add custom resize event#44
henriettemoe wants to merge 1 commit into
masterfrom
fix/add-custom-resize-event

Conversation

@henriettemoe

@henriettemoe henriettemoe commented Nov 1, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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