Skip to main content
More detail to the code
Source Link
wellmstein
  • 1.8k
  • 1
  • 15
  • 23

Try including your inputs inside of a

<form autocomplete="off" > .... </form>

Another alternative would be to use javascript in the afterRender/rerender methods to add the autocomplete attribute

component.cmp

 <ui:inputText aura:id="anInput" ...otherparams />

Render.js

afterRender: function(cmp, helper){
    this.superAfterRender();
    //your component will now be rendered and you'll be able to access the input via javascript and set attributes that are not supported by the ui:inputX
    
    //this will give you the html described here: 
    https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ui_inputText.htm
    var theinputdiv = cmp.find('inputX''anInput').getElement();

    //next we want to get input element which is a child
    var theInputItself = theInputDiv.childNodes[1];
    //and now turn off autocomplete
    theInputItself.setAttribute('autocomplete', 'off');

    //more concisely -cmp.find('anInput').getElement().childNodes[1].setAttribute('autocomplete', 'off');
}

Try including your inputs inside of a

<form autocomplete="off" > .... </form>

Another alternative would be to use javascript in the afterRender/rerender methods to add the autocomplete attribute

cmp.find('inputX').getElement.setAttribute('autocomplete', 'off');

Try including your inputs inside of a

<form autocomplete="off" > .... </form>

Another alternative would be to use javascript in the afterRender/rerender methods to add the autocomplete attribute

component.cmp

 <ui:inputText aura:id="anInput" ...otherparams />

Render.js

afterRender: function(cmp, helper){
    this.superAfterRender();
    //your component will now be rendered and you'll be able to access the input via javascript and set attributes that are not supported by the ui:inputX
    
    //this will give you the html described here: 
    https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ui_inputText.htm
    var theinputdiv = cmp.find('anInput').getElement();

    //next we want to get input element which is a child
    var theInputItself = theInputDiv.childNodes[1];
    //and now turn off autocomplete
    theInputItself.setAttribute('autocomplete', 'off');

    //more concisely -cmp.find('anInput').getElement().childNodes[1].setAttribute('autocomplete', 'off');
}
Source Link
wellmstein
  • 1.8k
  • 1
  • 15
  • 23

Try including your inputs inside of a

<form autocomplete="off" > .... </form>

Another alternative would be to use javascript in the afterRender/rerender methods to add the autocomplete attribute

cmp.find('inputX').getElement.setAttribute('autocomplete', 'off');