Datalist options not shown for fields with Autofill type predictions and autocomplete=off
Reported by
steve25...@gmail.com,
Apr 26 2016
|
|||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
Example URL:
Steps to reproduce the problem:
1. Open the attached test.htm in Google Chrome
2. Click the 'dropdown' button of the first input to view its datalist options
3. Nothing happens when pressing that button
What is the expected behavior?
After step 2, a list with datalist options should become visible.
What went wrong?
dropdown list for inputs with datalist doesn't open
Does it occur on multiple sites: Yes
Is it a problem with a plugin? No
Did this work before? Yes
Does this work in other browsers? Yes
Chrome version: 50.0.2661.87 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
After plenty of testing I found this issue to be very specific to a certain setup. You can solve the issue in the attached test.htm by modifying it in any of the following ways;
* change the name of the first input to anything but 'endPoint'
* change autocomplete to on for the first input (or remove the attribute)
* remove the last input (there need to be at least 3 inputs for this issue to persist)
* remove the form block
Please note that if there are multiple inputs with datalists and autocomplete="off" in the document, and the 'endPoint' input is in there as well; than all of the inputs will not show their respective datalists when clicking the 'dropdown' button. test2.htm showcases this behaviour.
The issue can be fixed on a page by running the below script. In the example of test2.htm it will fix it for all dropdowns even though the script only targets the 'endPoint' dropdown.
var endPoint=document.getElementsByName('endPoint')[0];
endPoint.setAttribute('autocomplete', 'off');
window.setTimeout(function(){
endPoint.setAttribute('autocomplete', 'off');
},100);
,
Apr 28 2016
,
Apr 28 2016
,
Apr 28 2016
Behavior is indeed weird. It seems like "endPoint" triggers an Autofill type prediction for "City", which means that in coordination with autocomplete=off, datalist choices are suppressed as well. Over to Sebastien who worked on autocomplete=off. P3 because it's rather a corner case.
,
Apr 28 2016
,
May 1 2018
,
Aug 3
This bug has an owner, thus, it's been triaged. Changing status to "assigned". |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by steve25...@gmail.com
, Apr 26 2016Typo in the fix script I provided in my post; it should read 'on' for the first autocomplete setting, like below. var endPoint=document.getElementsByName('endPoint')[0]; endPoint.setAttribute('autocomplete', 'on'); window.setTimeout(function(){ endPoint.setAttribute('autocomplete', 'off'); },100);