This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Andy Jakubowski
Posted May 20 - Read on Facebook

I’m getting weird behavior from Utils.isMobile. It seems to always evaluate to true no matter what device I choose.

Is anyone else experiencing this?

(Edited) Answer:
Utils.isMobile is a function, so you must call it like this: Utils.isMobile()

6 Comments

Koen Bok

Utils.isMobile is a function, so you should use it like this: Utils.isMobile()

Andy Jakubowski

Okay, that was easy—haha. The simplest things are sometimes the trickiest to spot. Thanks Koen!

Andy Jakubowski

Follow up question: Utils.isMobile() evaluates to true on my phone, but not on a simulated mobile device in Framer Studio. Is that expected behavior Koen? I appreciate your help!

Fran Pérez

Andy, yes it is.

Andy Jakubowski

I see, thanks Fran. I want to have distinct behavior on mobile devices, simulated or not. One hacky way of doing it is checking Framer.Device.deviceType, so I’ll use that for now.

Koen Bok

Yep. But I can see how that be confusing.

Read the entire post on Facebook