BW is filling the username into a phone field

There is a form with this as the phone field, it is output by wpforms in WordPress and I stripped out a few ID references.

<div id="wpforms-xxxxxxxxx" class="wpforms-field wpforms-field-phone" data-field-id="xx">
<label class="wpforms-field-label" for="wpforms-xxxxxxxxxx">Phone <span class="wpforms-required-label">*</span></label>
<input type="tel" id="wpforms-xxxxxxxxxxx" class="wpforms-field-large wpforms-field-required wpforms-masked-input" data-inputmask="'mask': '(999) 999-9999'" data-rule-us-phone-field="true" data-inputmask-inputmode="tel" name="wpforms[fields][xx]" required="" inputmode="tel">
</div>

When this page opens, BW puts the username into the phone field. I have a standard login for this website and the form is not a login form, but it does have fields for Name (first and last), email, password. So BW puts the username into Phone and then fills the password into the password fields.

If I’m not mistaken, BitWarden uses the name attribute to identify fields? If so, it shouldn’t be assuming a name like “wpforms[fields][99]” is my username (by what logic?). Further, it should be intelligent enough to also look at the type=“tel” and realize it’s a phone field and not even a text field.

Thanks for checking!

Hi @vigilantezack and welcome to the community,

Would custom fields work for your use case here? I know this can help with auto-fill especially for non-standard fields some websites may ask for.

Have you checked across services to help deduce if this is a BW issue or a specific website issue? Mine typically work fine. The issues I do come across tend to be incorrectly formatted website forms.

I had this problem with the profile form in iDrive. Puts username into a phone field.
I found that I could disable Autofil on each website individually, the option is hidden until you click edit.
If you’re not in Edit then you don’t see it.

But yeah, why does it put my username into the phone field?

A complex algorithm is used to identify username and password fields, because few web designers are thoughtful enough to name their username and password fields “username” and “password”, respectively.

On the other hand, when you define one or more custom fields, Bitwarden attempts to match the custom field name to either the id , name , aria-label , or placeholder property of the HTML <input> element (in that order of preference).

To fill your phone field, define a custom text field with the name set to wpforms-xxxxxxxxxxx or wpforms[fields][xx]. This will also prevent the username from being filled into this field.

You may have problems getting this to work if the values of xxxxxxxxxxx and [xx] are different each time that you load the form.

I think you’re missing the more simple problem here. Look at the HTML I posted. There is an input type=“tel” field and BW fills in the username there. Full stop, that just shouldn’t happen. Usernames don’t go in telephone fields.

I guess in some unique circumstance a website might use a telephone field as the username, but that seems like it should be a very rare occurrence.

My assumption is that BW should simply not autofill a phone number field with a saved username. It doesn’t make sense. It feels like a bug.

I was just trying to help you with your autofill problem. Fee free to propose feature request or a pull request, if you want to change the algorithms used in Bitwarden’s code.