Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Datalist Dropdown Arrow in Chrome

Chrome has apparently added a dropdown arrow to text inputs that reference a <datalist>. It's appearing in Chrome 34 (Canary) but not in the current stable build (Chrome 31).

It appears only when the text field is focused (see update) and is applied to both input types text and search.

It could be worse as far as native browser implementations go, but as you can see in the image, it conflicts with my design specs.

enter image description here

Does anyone know how to remove or replace this new feature?

<datalist id="list"><option value="foo"><option value="bar"></datalist> <input type="text" list="list" name="field" maxlength="50" autocomplete="off" spellcheck="off" placeholder="Jump To"> 

Update:

The arrow also appears when the field is hovered (not just focused) and unfortunately also has its own background color when the button itself is hovered:

enter image description here

like image 954
cantera Avatar asked Jan 05 '14 18:01

cantera


People also ask

How do I remove the arrow icon from a drop down box?

Every Bootstrap dropdown button or link has an ::after selector in CSS. ::after selector is often used to insert some text after the content of the element. In this case, the content is a dropdown arrow. To remove it, just make the content go 'none'.

How do I make a dropdown symbol in HTML?

Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.

How do I change the display width of a Datalist?

The only cross-browser solution is to: a) make input wider to make sure whole value is readable: JSFiddle b) use (or write) some JavaScript to emulate datalist so you can have full control over it's appearance.


2 Answers

Thanks to the comment by alexander farkas, here is the style rule to remove the arrow:

input::-webkit-calendar-picker-indicator {   display: none; } 
like image 163
cantera Avatar answered Sep 21 '22 23:09

cantera


As others have mentioned ::-webkit-calendar-picker-indicator { display: none } works at removing the arrow it would also impact the html5 datepicker on a <input type="date">,

To remove just removing the datalist input would be:

[list]::-webkit-calendar-picker-indicator { display: none; }

like image 41
jnowland Avatar answered Sep 22 '22 23:09

jnowland