You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change function is called even if the field value is not changed, when the input field loses its focus. If I execute async db requests when the change event occurs, this will not be efficient. IMHO the change event should only be fired if the input field value is actually changed. What do you think ?
The text was updated successfully, but these errors were encountered:
Tested it a bit. Indeed it does trigger change(), but only once on first focus and only on RIENumber. Will get back to it when I'm using the lib again.
It's using the !== comparator, which compares types of the objects as well. Since the initial value is presumably a number, but the new value becomes a string, they are treated as different.
Changing comparison to != automatically converts both to the same type, and the validation checks out.
I'm not sure if this is the best way to do it, although I don't see anything inherently wrong with this, since we're just dealing with text/numbers.
The change function is called even if the field value is not changed, when the input field loses its focus. If I execute async db requests when the change event occurs, this will not be efficient. IMHO the change event should only be fired if the input field value is actually changed. What do you think ?
The text was updated successfully, but these errors were encountered: