Google Chrome don't show datalist tag

半世苍凉 提交于 2019-12-11 10:26:14

问题


Since yesterday my google chrome don't show tags of a datalist

Like

    <!DOCTYPE html>

    <html>
    <body>

    <form action="/action_page.php" method="get">
      <input list="browsers" name="browser">
      <datalist id="browsers">
        <option value="Internet Explorer">test</option>
        <option value="Firefox">test</option>
        <option value="Chrome">test</option>
        <option value="Opera">test</option>
        <option value="Safari">test</option>
      </datalist>
      <input type="submit">
    </form>

    <p><strong>Note:</strong> The datalist tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>

    </body>
    </html>

I get for my dropdown datalist only the values, but not the tags "test" I use Version 73.0.3683.86 (Offizieller Build) (64-Bit)

But I use the same Google Chrome version on a another computer there the tags are still working


回答1:


I believe this bug is here https://bugs.chromium.org/p/chromium/issues/detail?id=945225

The first comment give a workaround :

A temporary workaround until the bug is fixed is to disable the feature by running Chrome with "--disable-features=AutofillDropdownLayout" command line switch or disable chrome://flags/#autofill-dropdown-layout




回答2:


I would have made this a comment to Tommotmot's question, but I didn't have the reputation points. The datalist worked on Chrome 72 (I don't know the exact version number) but stopped working when I updated to 73.0.3683.86 (Official Build) (64-bit) today.

As Tommotmot stated, only the value attributes appear from the option-tags. I will add that the options are not searchable, i.e., typing substrings of an option innerHTML does not reduce the option list. However, typing in substrings of the value does reduce the option list.




回答3:


This is still broken in Chrome Version 74.0.3729.131 (Official Build) (64-bit)

The workaround listed above...

...A temporary workaround until the bug is fixed is to disable the feature by running Chrome with "--disable-features=AutofillDropdownLayout" command line switch or disable chrome://flags/#autofill-dropdown-layout

...no longer works.

Then only work-around appears to be to use another browser.



来源:https://stackoverflow.com/questions/55355717/google-chrome-dont-show-datalist-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!