Currently, I have a registration form for events where users are required to input the date, time, and recurrence frequency (daily, weekly, monthly, or none). Additionally, there is an option for users to specify when they want the recurrence to end. However, I am facing a challenge with two different methods of ending the recurrence: using a "# of repetitions" field or a datepicker to select the end date.
To ensure consistency, I've set up a function that updates one input whenever the other changes. For instance, if a user sets the event to repeat daily for 5 times, the datepicker will display the date 5 days from the original. This setup works well but has one drawback - both inputs listen for changes, causing a loop where each change triggers the other input's value to update programmatically.
Given this scenario, I am seeking advice on how to distinguish between a change made by the user and one triggered by the programmatic inputValueChanges
.