How to write a condition for event trigger to run only on mobile?

I have an event handler on a component but only want it to run when the user is on mobile web or the app (basically don't run on desktop). What is the code required in the "Only run when" field?

Hey @asud! Hmm, this is a great question. I'm not sure if there's any flag we surface (like {{retoolContext.isMobile}} but as a pretty hacky solution, maybe you can do something like:

{{viewport.height < 800 && viewport.width < 800}}

1 Like

Thanks, while an actual flag would be great, this workaround works for now!!

1 Like