Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have enabled a datalist on my website, but I have noticed a major error when I scroll around my website.

My code looks like this:

HTML
<input type="text" name="search_keywords" id="search_keywords" placeholder="What are you looking for?" value="" list="all">
    
<datalist id="all">
 <option value="ATest"></option>
 <option value="BTest"></option>
 <option value="CTest"></option>
 <option value="XTest"></option>
 <option value="YTest"></option>
 <option value="ZTest"></option>
</datalist>


When you scroll down the web page, you can see the suggestions move around and not stick to the input box.

An example is shown here: https://codepen.io/samkough/pen/VQdVze

What I have tried:

- I have tried to use positioning on the by making it static but it didn't work.
- I also tried to lock the scroll of the website as the box is being typed, but that solution was too complex and wasn't really solving the problem.
Posted
Comments
Richard Deeming 23-Feb-18 10:38am    
Which browser are you using? I've tried Firefox, Chrome, Edge and IE11, and in all of them, the list disappears as soon as I start scrolling the page.
Samkough 23-Feb-18 11:00am    
I'm on chrome.
Richard Deeming 23-Feb-18 11:04am    
The latest version?

As I said, on 64.0.3282.186 (64-bit) on Windows 10, the list disappears as soon as I start to scroll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900