I know web compose ui is experimental. But is this...
# compose-web
l
I know web compose ui is experimental. But is this a know issue with display density? For some reason landscape on my phone renders with the correct density, but portrait does not. This is reproducible in a desktop browser when you preview for mobile in dev tools as well
j
Which browser are you using on your phone? There is an open issue regarding aspect ratio on phone not working correctly. https://github.com/JetBrains/compose-multiplatform/issues/3754 I had similar issues in scaling on Chrome. However, after adding
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
as a workaround, it works better. Not sure if it will fix your issues, but at least worth a try 🙂.
l
@Justin Salér chrome and firefox on both desktop and mobile
@Justin Salér nice that worked!
Screenshot_20240205-224042.png
🦜 1
Is that expected to be required, or is it actually that bug that you linked?
d
I'm not actually familiar with what Compose WASM plans, but specifying
meta name="viewport" "width=device-width, initial-scale=1"
is fairly standard advice in web dev I believe. See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#viewport_basics I vaguely remember banging my head against the wall until I learned about that 🙂
💜 1
l
Good to know, thanks for the tip!