Home > Mobile >  How To Prevent Chrome Password Manager Popup After Hiding Text Input?
How To Prevent Chrome Password Manager Popup After Hiding Text Input?

Time:08-27

I'm creating a comment system, using Vue 2. Vue is probably not causing my problem, but I thought I'd mention it.

I have a parent comment container and a child comment editor.

The parent lists multiple comments, which can be in read mode (regular display) or write mode (editor).

The editor has:

  • text input element (title)
  • textarea element (body)
  • button element for submitting changes

Upon clicking the button, the comment editor updates the comment server side. Upon completion, it emits an event to the parent comment container.

The comment container then hides the comment editor. It's the act of hiding that triggers Chrome's password manager.

I know this for a fact, because I put the hiding on a setTimeout of 1000 ms to test it. It's not the button click. It's the hiding.

I tried:

  • setting 'prevent' and 'stop' on the comment editor's button click
  • using a 'span' as a button in the comment editor
  • setting the text input's value to an empty string before hiding the comment editor

Nothing works.

I'm not sure why Chrome even offers to save credentials. There is no password input on the page.

For some reason, it thinks the text input is a username. It offers to save it with a password it had already stored for me.

What can I do to prevent this completely unnecessary offer of saving credentials?

CodePudding user response:

This was caused by the fact that there was a password input present on the page, after all.

It was in another Vue component: login/registration.

When a user is publishing/editing comments, the user is already logged in. The login/registration wasn't shown, so it slipped my mind. But it's this component's password input that triggered the password manager popup.

I solved this problem by rendering the sign in form, and its password input, conditionally: only when the current page visitor is not logged in.

Solving this problem comes down to not having a password input appear on your page, anywhere.

I feel Chrome shouldn't show the password manager when the password input wasn't even visible, let alone being filled out. I've submitted this issue with them.

  • Related