Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Datalist arrow to be always visible

Tags:

I am trying to have datalist list element always visible. As standard after focused lost, the arrow disappears.

I would like to have it always like this: Here is the plunker: https://plnkr.co/edit/?p=preview

<input list="browsers" name="myBrowser" />  <datalist id="browsers">    <option value="Chrome">    <option value="Firefox">    <option value="Internet Explorer">    <option value="Opera">    <option value="Safari">  </datalist>

enter image description here

ENVIRONMENT: Angular directive

Any ideas how to achieve it?

Best,

like image 867
amol01 Avatar asked Feb 04 '16 09:02

amol01


People also ask

Can you style Datalist?

HTML5 <datalist> elements cannot be styled.

Is the Datalist tag and select Tag same?

Generally, both the tags are used for choosing an option from the given list. But the main difference between both is that in the <datalist> tag the user can enter its own input and add that as an option with the help of the <input> element whereas the <select> tag doesn't provide this feature.

Is Datalist supported by all browsers?

Unfortunately, Internet Explorer and Chrome are the only browsers to support datalists on range inputs at this time.

How the Datalist tag can be used in HTML?

The <datalist> tag is used to provide an "autocomplete" feature for <input> elements. Users will see a drop-down list of pre-defined options as they input data.


1 Answers

I have got the arrow always visible using css:

input::-webkit-calendar-picker-indicator {                opacity: 100;             }
    <input list="browsers" name="myBrowser" />      <datalist id="browsers">        <option value="Chrome">        <option value="Firefox">        <option value="Internet Explorer">        <option value="Opera">        <option value="Safari">      </datalist>
like image 169
amol01 Avatar answered Oct 15 '22 21:10

amol01