Dogfalo / materialize

Materialize, a CSS Framework based on Material Design
https://materializecss.com
MIT License
38.86k stars 4.74k forks source link

materialbox enlarges images to window size. #3164

Open johnyluyte opened 8 years ago

johnyluyte commented 8 years ago

In the current design, the materialbox enlarges images to "window size". For example:

When a user clicks on the image, it will enlarge to something close to 1920x1080 instead of 600x600. It will make the image blur in some cases.

Codepen demo: http://codepen.io/ChunNorris/pen/bpZyPd

Use naturalWidth and naturalHeight instead of window.innerWidth and window.innerHeight can fix this problem.

Please see this commit: https://github.com/johnyluyte/materialize/commit/4489d65fc7c5dab719d82b0c399b584ee3ee7cf3

After doing a quick search on the reported issues, I didn't find any issue about this behavior. So I don't know if this is actually an issue or its just a normal behavior. But its not a normal behavior in other library I used (e.g. FancyBox).

gubi commented 7 years ago

Please allow us to configure it by passing a parameters object

levjad commented 6 years ago

Would be nice if there would be a official 'fix' for this bug.

hudsantos commented 3 years ago

Closed issue but not sure if this is already fixed.

Anyway, this answer provides a related workaround https://stackoverflow.com/questions/51389307/lightbox-onclick-change-src-then-change-back/65556831#65556831