clients icon indicating copy to clipboard operation
clients copied to clipboard

Autofill does not work on textarea elements

Open TheJoelGray opened this issue 4 years ago • 17 comments

My QNap NAS admin software in a recent update changed their login form's username field to use a <textarea> rather than an <input> element. Bitwarden no longer auto-fills the username field. I have performed a couple of tests to verify my hypothesis.

  1. On my QNap NAS admin login I used Dev Tools to change the HTML from textarea to input and then clicked on the entry in the browser extension again. This caused the username to fill out properly.

  2. I went to another site that I have saved in BW and verified that autofill is working. I used dev tools to change the username field from an input to a textarea and cleared the contents. Clicking on the browser extension entry no longer filled out the username.

TheJoelGray avatar Apr 24 '20 15:04 TheJoelGray

Using a textarea for a username input seems quite odd. Can you target it with a custom field?

kspearrin avatar Apr 24 '20 15:04 kspearrin

Agreed that it's odd, I don't know why the changed it. I'm not sure what you mean by targeting it with a custom field. Can you point me to the right docs on what that provides and how to do it?

thepaleone avatar Apr 24 '20 16:04 thepaleone

https://help.bitwarden.com/article/custom-fields/

kspearrin avatar Apr 24 '20 16:04 kspearrin

Huh, I didn't know about that feature, that is very cool! Unfortunately I tried to come up with a solution based on that with no luck. The textarea has the id and placeholder both set to "Username" and none of the other attributes listed in the article are used.

Setting up a custom field called Username did not result in the field being autofilled.

thepaleone avatar Apr 24 '20 17:04 thepaleone

Came to this issue just now, same problem (same QNAP Admin software, it seems). Can confirm behavior, and also tried custom field, incl. regex matching. Textarea fields seem to be exempt from the search patterns.

lyrixderaven avatar Apr 25 '20 07:04 lyrixderaven

I can confirm that this is an issue for me too.

PaulMeadSiliconBullet avatar Aug 19 '20 10:08 PaulMeadSiliconBullet

Same issue here. It was also my first thought that a custom field would solve the problem (as it does on other sites too), but no luck on the QNAP login page.

abrewner avatar Sep 04 '20 07:09 abrewner

As a temporary stop-gap I simply found the login page on my QNAP system and edited it, changing the element to a tag. It seems to work just fine that way; however when I perform firmware upgrades I have to go do it again. Fortunately it's a quick fix.

TheJoelGray avatar Sep 05 '20 17:09 TheJoelGray

Is there a permanent solution to this? I tried using a custom field to fix the auto-fill issue but it still doesn't work. How can I make Bitwarden support textarea tags while ignoring what it finds inside the textarea tag (such as id=name, etc)?

rewritten1 avatar Nov 16 '20 16:11 rewritten1

+1 maybe this suggestion would be elegant: https://community.bitwarden.com/t/bitwarden-doesnt-scan-the-textarea-field/12586

bassarf avatar Nov 24 '20 18:11 bassarf

Interesting, I found this page via Google after looking for solutions as to why textArea doesn't respect autocomplete.

I'm not sure if this applies to this thread/issue, but it sounds like it.

From a clean html-document I create a form with a submit button and a textarea with autocomplete="on". It never works. If I switch the textarea for an input element it works fine...

Tried on FF and Chrome to no avail. The docs says it's supported and should work (given that the requirements listed are met, which I've ensured is true): https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

Edit: turns out it's not supported in Chrome https://www.chromestatus.com/feature/5680387573415936

upscalebaby avatar Dec 03 '20 12:12 upscalebaby

@TheJoelGray I found a simple greasemonkey script that converts the username field into an 'input' which allows autofill to work. You just need to modify the "@match" field to your qnap address. Here is the link to the script: https://greasyfork.org/en/scripts/419313-fix-qnap-qts-username-autofill/code

zhaoyibo avatar Feb 18 '21 15:02 zhaoyibo

I found this issue also with QNAP. It does not work with Custom Fields. I created a dummy Web Page and tested it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Simple Auto Type Test Page</title>
  </head>
  <body>
    <label for="simpleinput">Simple Input</label>
    <input id="simpleinput" autocomplete="off" placeholder="User Input"/><br />
    <label for="simpletextarea">Simple TextArea</label>
    <textarea id="simpletextarea" autocomplete="off" placeholder="User TextArea"></textarea><br />
    <label for="simplepassword">Simple Password</label>
    <input id="simplepassword" type="password" autocomplete="off" placeholder="User Password" /><br />
    <label for="simpledata">Simple Data</label>
    <input id="simpledata" autocomplete="off" placeholder="Data Value" /><br />
  </body>
</html>

The Simple Input and Simple Password fields got filled in my the standard fieldsm the Simple Text Area did not get filled by the Custom Field and the Simple Data got filled in by another Custom Field. I also toggled autocomplete from off to on and it made no difference.

Not sure if this issue is specific to QNAP - but it is rather frustrating!

egooner avatar Mar 29 '21 13:03 egooner

Yeah this is still an issue. It's frustrating because it makes it unusable on QNAP.

We can put regexes in, yet we can't ask it to look in a textarea box instead?

levihb avatar Jan 25 '22 15:01 levihb

having this problemm too on another page.

SVNKoch avatar Feb 10 '22 11:02 SVNKoch

I have reported the issue to QNAP through a support ticket, asking to change the textarea class to an input class. They said they will send the request to their development team, but somehow I doubt they will actually do anything.

fabiengagne avatar Mar 10 '22 14:03 fabiengagne

For those of you looking for a workaround, this reddit poster provided one - that you might find it useful using greaseMonkey extension: here

televisi avatar Jul 30 '22 23:07 televisi

Someone opened a pull request that should fix this issue. 4155

fabiengagne avatar Dec 30 '22 00:12 fabiengagne

I wonder why such a small change takes several years to fix. Even worse: Now with an already available PR...Nobody cares to review it ???

olluz avatar Apr 02 '23 12:04 olluz

Sad and problem still here with QTS 5.0.1.2376.

vinada avatar May 05 '23 15:05 vinada

Closing this as https://github.com/bitwarden/clients/pull/4155 has been merged.

djsmith85 avatar May 22 '23 16:05 djsmith85