Vue-multiselect: remove autocomplete in chrome browser

Created on 16 May 2018  路  12Comments  路  Source: shentao/vue-multiselect

I want to thank you for your work, vue-multiselect works really great!
Can you please replace the autocomplete="off" with autocomplete="nope" as a bug fix for chrome wich ignores the first one ?
the bug
https://bugs.chromium.org/p/chromium/issues/detail?id=370363
the solution (on the bottom of the section "Disabling autocompletion")
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#Disabling_autocompletion
I tested it and it works well (for now)

enhancement

Most helpful comment

I have resolved this issue by using refs.
Below is the code which i have written in mounted life hook.

// **multiselectRef** is ref of the multiselect componenet
mounted(){
       this.$refs.multiselectRef.$refs.search.setAttribute("autocomplete", "off")
}

All 12 comments

Thanks! Sounds good :)

@shentao
I can't see this change in master. Any chance to merge it soon?

@shentao can you reopen this? It looks like it a PR was not opened. Also, it seems that the "nope" is ignored by Firefox and it reverts to default autocompletion behavior.

@shentao
When to expect release with this fix?

It seems autocomplete="nope" doesn't work anymore in Chrome, it should be autocomplete="off" again..

I sooo hate that happening...

tl;dr I doubt there can be "one right way". How about a string option which defaults to "off"? My current ~hack~ solution right now, primarily because of Chrome, is to use the @open event to update the autocomplete attribute to new-${id}-field which has worked so far.

The long version:

It appears there _is_ an official answer. This explains the reasoning behind it ("think of the ~children~ users!")

https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164

so... autocomplete="off" no longer works as an option.

This says what to use:

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill

So there it says it's still to supposed to work but... no.

And the battle rages here:

https://bugs.chromium.org/p/chromium/issues/detail?id=587466

Any news about this fix ? I still have autocomplete="nope"
I have to fix it with document.getElementById("elementid").setAttribute("autocomplete", "off")

Can this be re-opened? Is a minor yet annoying usability bug.

This is really annoy. It's still nope instead of off. I'm using v2.1.6

Screen Shot 2020-01-31 at 2 41 40 PM

I have resolved this issue by using refs.
Below is the code which i have written in mounted life hook.

// **multiselectRef** is ref of the multiselect componenet
mounted(){
       this.$refs.multiselectRef.$refs.search.setAttribute("autocomplete", "off")
}
<input type="text" id="myid">

$( document ).ready(function() {
         $('#myid).attr("autocomplete","false");
         $('#myid').attr('readonly', 'true');
         $( "#myid" ).click(function() {
                 $('#myid').attr('readonly', null);
         });
});
Was this page helpful?
0 / 5 - 0 ratings