71

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

cantera
  • 24,479
  • 25
  • 95
  • 138
  • 7
    I haven't looked, but this should be simple. Go into the dev console enable shadowdom and inspect the input element's shadow dom. Then you will see the arrow element including his pseudoclass it's propable a pseudoelement something like 'input::-webkit-list-arrow'. – alexander farkas Jan 06 '14 at 00:24

8 Answers8

135

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

input::-webkit-calendar-picker-indicator {
  display: none;
}
cantera
  • 24,479
  • 25
  • 95
  • 138
27

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; }

jnowland
  • 2,064
  • 19
  • 15
  • This should be the highest rated answer since it has the highest level of specificity, making it more robust for future form changes. – stwr667 Oct 12 '20 at 06:13
  • 1
    It should probably be noted that this is a Chrome-specific solution to a Chrome-specific problem, c.f: https://stackoverflow.com/questions/13693482/is-there-a-way-to-apply-a-css-style-on-html5-datalist-options – stwr667 Oct 12 '20 at 06:16
  • Can anyone suggest me a way to set this property using javascript(typescript to be more specific) – Arbaz Sheikh Nov 12 '20 at 05:53
  • 7
    Doesn't seem to work in 2021. – isherwood Oct 20 '21 at 16:27
9

Thanks to Cantera. I didn't want to get rid of the black arrow entirely, just the gray square surrounding it.

input::-webkit-calendar-picker-indicator {
  background-color: inherit;
  }
Toby Belch
  • 101
  • 1
  • 6
8
input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

Also removed the arrow for me and I found created a better clicking experience to still click where the arrow would be, you can even increase the the width and height of it > 1em and in the input maybe put a custom arrow as a background image, where the arrow would be.

dmartins
  • 261
  • 2
  • 2
3
input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

It's work for me; (use display:0 not work on chorme)

meomay
  • 31
  • 1
2
datalist::-webkit-calendar-picker-indicator {
    display: none; 
    opacity: 0;
}

It is okay but this css code will hide any calander on page. Like I'm using datepicker calender and this will also hide the controls including datalist and datetime picker.

-2

Set the list option of parent input to be empty, <input list="" ... /> , eg :

<input
  list=""
  name="option"
  id="input"
  autocomplete="off"
>

<datalist id="datalist">
  <option>Carrots</option>
  <option>Peas</option>
  <option>Beans</option>
</datalist>

see mdn customizing_datalist_styles example

Jimmy Obonyo Abor
  • 7,335
  • 10
  • 43
  • 71
  • 5
    This disconnects the datalist from the input, so it no longer functions. The MDN example manually enables the datalist using JavaScript to avoid the input from getting "datalist attached" styles... but that's at a loss of functionality and is a bad idea (e.g. the user can no longer navigate the datalist with the keyboard). – Aaron Cicali Apr 30 '21 at 19:28
-4

try -webkit-appearance: none that should remove the default styles

jmore009
  • 12,863
  • 1
  • 19
  • 34