How to make dynamic range Options Select Form Based on Selected State
Hello, this is my first question, and I appreciate your assistance.
I have a select input to provide information about the number of children someone has. The options in this select range from 0 to a maximum of 20, obtained using
Here's my code :
I want to make the range in these options dynamic by utilizing
The code I created successfully achieves this, but after a while, the values in the options change unexpectedly.
For example condition:
I have a select input to provide information about the number of children someone has. The options in this select range from 0 to a maximum of 20, obtained using
array_combine.Here's my code :
I want to make the range in these options dynamic by utilizing
afterStateUpdate(), where the initial range is determined based on the $state chosen by the user.The code I created successfully achieves this, but after a while, the values in the options change unexpectedly.
For example condition:
- The select option initially contains numbers from 0 to 20.
- When a user selects the number 3, the select options should change to display numbers from 3 to 20.
- However, the issue I'm experiencing is that, for a brief moment, the selected number 3 changes to 6, as if there is a glitch that temporarily alters the $state to 6.
- I have already added debounce to
live(), but it doesn't seem to resolve the issue. Can anyone help me fix this problem?

