How to make Datalist arrow to be always visible

2019-02-16 11:33发布

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,

2条回答
Emotional °昔
2楼-- · 2019-02-16 12:11

The checked answer works only for Chrome.

For IE and Firefox, I found the answer here: https://stackoverflow.com/a/39555400/1937033

查看更多
对你真心纯属浪费
3楼-- · 2019-02-16 12:27

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>

查看更多
登录 后发表回答