Quantity selector: Does not define the initial value and how to define its value in an variable


I have two problems, the first is: The Quantity Selector don`t set an initial value when he is rendered.

I wanted that when my page is mounted, I get the value from Quantity Selector for the set this value in an page variable, but the value “don`t exist”, only after change the value in input of the Quantity Selector that value is seted.

In isolation mode Isee that the event that call the function for set this value is “Component onChange”, how I do for define this value when the page is created, because I don`t can choose event “Page mounted”?

The second problems is more important: I would like too define this value in page variable whenever the value is changed when the user press the button in the Quantity Selector, but in isolation mode I don`t can define an page variable or an app variable. How to I set the value in page variable or app variable whenever the value is changed by user??


I got so frustrated with that thing I actually hand-made my own out of a Row with 3 cells, +/- icons and a paragraph component. I just handle the math in the +/- icon tap events myself and update the value of the number stored in a page variable that’s bound to the paragraph component in the middle. I just styled the corners of the cells to make a pill shape. It works perfectly.


1 Like

Thank you! I did it. Although more work, worked perfectly!

Really it’s very frustrating that some tools don’t work…

For anyone else struggling with this, like I did, you can try the following. Enter component isolation mode and set the private variable ‘privateQuantity’ to your desired initial value.
Changing the default value for the minimum value property or setting the initial value for the privateQuantity private variable didn’t do anything.

what formula did you use in each button?
Help me,please :laughing: