datalist-polyfill icon indicating copy to clipboard operation
datalist-polyfill copied to clipboard

Spaces are missing

Open jenstornell opened this issue 3 years ago • 2 comments

I have spaces in my datalist.

option1
    option2
    option3
option4

It shows like this with polyfill.

option1
option2
option3
option4

Maybe convert spaces to  

jenstornell avatar Sep 15 '20 06:09 jenstornell

@jenstornell thanks a lot for your feedback.

When comparing this either to <option> elements in simple, regular <select> element, and even regarding the rendering of <option> items in an <input> elements ´` "dropdown", the spaces are ignored by the browsers as well.

image image

So quick question back: Are you expecting the rendering of those spacings by observations of regular behaviour in browsers that I'm missing? Or is it out of your "own" expectations?

mfranzke avatar Sep 17 '20 19:09 mfranzke

Here is my code:

<datalist id="search_places">
    <option value="Kalmar län"></option>
    <option value="        Mörbylånga"></option>
    <option value="        Kalmar"></option>
    <option value="        Västervik"></option>
    <option value="        Vimmerby"></option>
    <option value="        Borgholm"></option>
</datalist>

Chrome

chrome

Edge

edge

Firefox (polyfill)

firefox

All browsers look a bit different, but Firefox is the only one not prefixing options with spaces.

jenstornell avatar Sep 18 '20 05:09 jenstornell