Open darrynten opened 3 months ago
Any updates on this?
In case anyone else is stuck on this, I resolved it by setting height: 100vh
on the element inside the modal.
A setting of height: 100%
does not work, it must be 100vh
in order to get the right value on document.body.clientHeight
@darrynten I can seem to reproduce the issue. Can you record a video?
https://github.com/user-attachments/assets/7bdaad86-fc58-4715-8a54-3ca3066b51f4
I've already merged and moved on but please note this was not within the context of react in any way, it is only when using the vanilla ui-modal
components in a plain old html document with the app bridge CDN script only.
Describe the bug
Opening a max modal and inspecting the document.body you will see that
clientHeight
andoffsetHeight
are always 0.The
clientWidth
andoffsetWidth
values are correct.The only way you can get any sort of height estimate is to use
window.opener.document.body.clientHeight
instead, which is of course an incorrect value.To Reproduce
Steps to reproduce the behaviour:
variant="max"
modaldocument.body.clientHeight
and you will get a value of 0document.body.clientWidth
and you will see the correct valuewindow.opener.document.body.clientHeight
Expected behaviour
The
document.body.clientHeight
and related values should be the correct value inside of the max modal context.Contextual information
Packages and versions
List the relevant packages you’re using, and their versions. For example:
@shopify/app-bridge
@cdn
Platform