I am using Google Maps Javascript v3 to setup autocomplete on an HTML input field like so:
http://imgur.com/Rm6X2FI.png - (w/out autofill)
The issue I\'m having
For those that are using Angularjs, I created a directive based on @Rimmel answer that is working for me in Chrome 66.0.3359.139. Below is the code:
(function(){
'use strict';
angular.module('app.directive')
.directive('stopAutofill', stopAutofillDirective);
function stopAutofillDirective() {
return {
restrict: 'A',
link: function (scope, element) {
var observerHack = new MutationObserver(function () {
observerHack.disconnect();
element.attr("autocomplete", "new-password");
});
observerHack.observe(element[0], {
attributes: true,
attributeFilter: ['autocomplete']
});
}
};
};
})();