Fit modal within the browser window

I have created a Component where you can click an icon to have an image displayed in a modal.
https://filecamp.com/img-test-july8-2023/

It works as it should, except when the browser window is small. Then the modal doesn’t adjust to the height:

Instead, the size of the modal should be more like this:


(where you can see the entire image).

Any ideas on what to do?:pray:

Hello @JesperF,

Thanks for writing in!

You can set the maximum height of the Image element in relation to the height of the browser.

Kindly let us know how it goes.

Hi @ruenel

Thanks a lot :pray:

That helped and the image now fits to the height of the browser window :ok_hand:

The only problem left is that the modal now doesn’t fit the image size, leaving some white space left and right of the image:

I guess it has something to do with the modal sizes, but I can’t seem to find out what to change:

Any ideas?

Thanks again.

Hey @JesperF,

The Modal cannot conform to your image aspect ratio so it would be best that you set the Modal’s background to transparent so that white space disappears.

Hi @christian

Thanks a lot … that helped. Looks a lot better now:

You can close this issue … thanks again! :pray:

Hi @JesperF,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.