简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM