Programmatic and Autofill Input Detection in AuroInput #599
StephenRiosDev
started this conversation in
Technical Research Documents
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Programmatic Input Detection Problems
Issue 1
Previously we were only running validation when the value of an input changed and the input had focus. With this new implementation we are saying we want to run validation even if the input doesn’t have focus.
This causes a race condition for validation. Consider the following scenario:
el.resetthis.value = undefinedthis.validation.resetthis.validation.resetcalled byresetandthis.validation.validate()called by the input handlerPossible Solution
We might need to look at implementing a more specific autofill detection that taps into the autofill CSS such as using the
:-webkit-autofillto detect animation starts in JS for the pseudo selector, or detecting a change in background or filter color as applied by browsers to determine if an autofill has happened. Both solutions can be seen here: https://stackoverflow.com/questions/11708092/detecting-browser-autofillIssue 2
We are now calling validation at times we specifically didn’t want to before, and this is breaking some tests because validation is running and failing, specifically for unit tests that test values that are currently unsupported by our date utilities, namely:
The work to support these individual formats was taken up but never completed, see GitHub ticket: AlaskaAirlines/auro-library#134
Possible Solution
Since these unit tests literally just set the value and check for the value to be equal to what was set, it’s probably safe to comment them out for now until the work to support these formats in the date utilities is completed.
Beta Was this translation helpful? Give feedback.
All reactions