I can suggest using a flag which will check if the change event is fired by the user or not, and based on this information to execute or not the desired code.
I hope this will help to achieve the desired result.
Thank you for your answer, I will go with that workaround.