Bug within Wix itself Report: .valid not updated upon autofilled fields

The .valid property of text input elements(might only be ‘password’ fields, might be all) seems to be updated ‘onkeypress’, not ‘onchange’ (should make sense to javascript programmer). Either that or should actually be “.valid()” and validity should be rechecked at the time valid is called.

The reason I say this is because I have a password field on my website. When I type into the field, then check the “.valid”, it works correctly. However, when a password manager automatically fills the field, then I check “.valid”, it returns the value it had from because the password manager filled the field.

Is this the right place to report bugs within Wix itself?

No reply to this one?

Tag some admins/mods. @aleksander-denga @alexander-jdanov @talyaro

1 Like

Hi. I’ll take a look, but, please, add more info next time for quicker response, like:

  • example code (ideally, link to page with this code)

  • scenario (what do you do)

  • result (what is wrong and what do you expect)

Regards, Alex

Seems like there is an issue with onChange method. I’ll pass it to our developers to check.

Meanwhile, you can try the following workaround:

  • You’d need to install ‘lodash’ module if you don’t have it yet ( this is where you install npm modules)

  • add: import { debounce } from ‘lodash’ on top of your page code

  • Put the following code in your onReady block:

   $w('#input1').onChange(debounce(function (event) {
       //your validation code goes here
   }, 200));

Please let me know if it works for you.
Regards, Alex

1 Like