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

What is Framer? Join the Community
Return to index
Daniel Keller
Posted Jan 22 - Read on Facebook

When you click on sliders the knob jumps to that position. Is there any way to disable that behaviour? So that you have to drag the knob to change the value?

Im asking because I have a

SliderComponent with the event:
slider.on "change:value"

The Problem is that I get
RangeError: Maximum call stack size exceeded.

I only get this error when I use the Framer App on iOS and click somewhere on the slider outside the knob area.

I can drag the knob just fine and it works. Also in Framer Studio directly everything works perfectly I dont get any RangeErrors.

2 Comments

Paul Justin Farino

If you want to prevent the click on the SliderComponent try
`slider.sliderOverlay.off Events.TapStart`

If that doesn't work could you share your prototype or abstract it out to another file? Usually you get that when you have recursive calls.

Trevor Coleman

Maximum call stack size exceeded means that you've created an infinite loop somewhere.

Basically a function is calling a function (or functions) that calls itself.

If I make a function add(a,b) and a is 5 and b add(a,b)

The computer will go:

First up add 5 to... hold on, do that after this next function, 5 plus.... hold on, do that function and then the first function after this next function, 5 plus... ok hold on remember all three of those in order and then do this... 5 plus...

The memory where it remembers what it's doing while it figures out the smaller stuff is called the call stack. When there's an infinite loop, it eventually it runs out of memory to hold the list of things it's got to do. (It exceeds the maximum size of the call stack)

So somewhere you are calling something that calls itself. Is there a function in the Click handler that calls the drag handler that calls the click handler? Is there an infinite loop somewhere?

Follow the logic step by step and see if you end up calling the same function twice, and see if one of the variables depends on itself somewhere in those calcualations.

Consider that values may not be initialized the first time you run through the logic, so if you have a bunch of if statements inside a loop, none of them might be triggered yet if it happens before some value is set.

This may not be related to the knob at all, it could be just a simple logic problem.

Read the entire post on Facebook