I encountered an issue with an input tag that has a specific logic:
https://codepen.io/ion-ciorba/pen/MWVWpmR
In this case, I have a minimum value retrieved from the database (400), and while the logic is sound, the user experience with the component leaves much to be desired. As it currently stands, users are unable to enter values below 400, which can be frustrating. I am looking for a way to improve the interaction without restricting the user from typing. Are there alternative methods besides just using 'change' and 'input' events? How can I enhance this interaction to be more user-friendly while still respecting the minimum value of 400?
Perhaps a better approach would be:
if (numberInputValue == "" || parseInt(numberInputValue) < parseInt(min)) {
numberInputValue = min;
} else if (parseInt(numberInputValue) > parseInt(max)) {
numberInputValue = max;
}