I dont want to use display:none because you still render the component or element in the background. I want it to just not render at all
Lucas G
10 months ago
I’ll need to double check the actions tree. I think I needed something like this when I was starting but I just used a custom action to return true/false if below a certain viewport and I used that for the variable
but I guess its best to use it on the page, so it can be reused
@Lucas G
Jax Wedel
10 months ago
how did you get that width? this is mine
@Lucas G
Lucas G
10 months ago
Set the arguments and output event up
You can see how on the screenshot
Jax Wedel
10 months ago
ah I see it now. I missed it
Lucas G
10 months ago
Sounds like you got it
For now, this is probably the way to do it unless 'display: none' is acceptable or if toddle team releases more native actions around viewport
Jax Wedel
10 months ago
I tried opening the website template that comes with toddle to see how they did the menu there - but that was even more confusing 😅
Laetitia | Pinshasa
5 months ago
Hey @Lucas G! How to check if the custom action actually works? Because I created that action and event (on load and on attribute change), and it doesn't seem to detect the viewport cc @Andreas Møller
Tod
5 months ago
Great energy @Laetitia | Pinshasa! Your continuous contribution to the toddle Community just made you advance to Community Level 4!
The function works. You can log the event to console
There is an action for it which you can fire on the event flow
saillmone
3 months ago
Hey guys, I hope you're fine! I followed the code provided by Lucas, but still have issues to make it working. how can I get the event "isBelow" data back ? Thanks a lot
Andreas Møller
3 months ago
In this case true or false is going to be the event in the toddle workflow
saillmone
3 months ago
Thanks, it's working fine. But the false value is "undefined" and the true is a boolean as excepted. I made a string return in order to make it working fine.