Autocomplete only works when a form is submitted. Because Lightning does not use a form
tag, and it never submits forms to the server (it's all AJAX-y REST API calls), browsers are convinced that there's nothing to save in the autocomplete cache.
If you really want to, though, you could choose to put a form
in your application or component, submit it, and it will cause the browser to remember the values.
A simple application demonstrates this:
<aura:application extends="force:slds">
<form aura:id="form" target="iframe" action="#" onkeypress="{!c.blockEnter}">
<lightning:input type="text" label="Name" name="name" />
<lightning:button label="Add to Autocomplete" iconName="utility:save" onclick="{!c.saveAutoComplete}" />
</form>
<iframe id="iframe" name="iframe" class="slds-hidden" />
</aura:application>
({
blockEnter: function(component, event, helper) {
if(event.which === 13) {
event.preventDefault();
}
},
saveAutoComplete: function(component, event, helper) {
component.find("form").getElement().submit();
}
})
When you enter a value, then click the button, your browser will remember the stored value. Please feel free to customize this behavior as you like.