Skip to content

Add the ability to set a custom "autocomplete" html attribute #5628

@fmonts

Description

@fmonts

The "autocomplete" attribute is now hardcoded to off here:

https://github.com/select2/select2/blob/develop/dist/js/select2.js#L1964
https://github.com/select2/select2/blob/develop/dist/js/select2.js#L4064

Unfortunately, the off value is ignored in Chrome (see here: https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164)

And this is what happens if you have addresses saved in Chrome and you have forms with a name, address, country etc., the Chrome autocomplete UI goes above the Select2 and it's impossible to see the options:

image

To fix this, we need to set a custom autocomplete value, ex. autocomplete="campaign-countries".
I think Select2 should implement a way to set a custom value, with an option or by reading it from the original select.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions