Apple Event: May 7th at 7 am PT

Datalist Support in Safari

Is there any way to get full datalist support in Safari?

Originally basic support came a long time after other browsers but it still does not fully support datalists where for example a datalist has a value and a description.

In Safari only the value/code is displayed and not the title/description which makes it very difficult to know what the code/option relates to.


This example demonstrates it well:

HTML5 <datalist> autocomplete examples (codepen.io)


Examples 3 and 4 show a value and a description for each option if viewed in Chrome or Edge as is common in select lists too but it only shows AF, AX and AL... in Safari and then it is difficult to know what these countries are.


Support has been in Chrome since 2012 and Edge since 2014 and being able to use a searchable drop-down for something long like country and ethnicity would seem pretty important but 12 years after Chrome supported it, it is still not usable for this scenario in Safari.


Other than have to add JavaScript to convert datalists to selects on Safari and lose the benefits will datalists be properly supported at some point?

Posted on Apr 26, 2024 8:13 AM

Reply
9 replies

Apr 30, 2024 8:25 AM in response to robinwilson16

robinwilson16 wrote:

As you can see from above this is totally unusable on iPhone for something where only the title would have any recognisable context.

For example students completing an online enrolment form at a college need to select may options where the code is just an ID number from the database so without the description it is impossible to know what any of them mean.

With other browsers/browser engines if the code and description are the same (such as title: Mr, Mrs) then only the code is shown but where they differ then both are always displayed.

Data lists enhance usability as for long lists they make it much easier to find the corresponding option and I tend to add these to all drop-downs for consistency but on iPhone it has the opposite effect so I have to use JS to detect webkit and convert all data lists to select lists.

I used to do this for IE11 but shouldn't need to still do this for Safari in 2024.
I can't understand why it doesn't have proper support for this as a data list seems somewhat fundamental.

Got it. Well, I doubt it'll change as this behavior is part of WebKit, but you can submit feedback if you'd like.


Feedback - Safari on iOS - Apple

Apr 26, 2024 6:25 PM in response to robinwilson16

robinwilson16 wrote:

Examples 3 and 4 show a value and a description for each option if viewed in Chrome or Edge as is common in select lists too but it only shows AF, AX and AL... in Safari and then it is difficult to know what these countries are.

Looks fine to me (using Safari 17.3), it simply puts the country/region name as a subtitle:



Apr 30, 2024 1:52 AM in response to robinwilson16

As you can see from above this is totally unusable on iPhone for something where only the title would have any recognisable context.


For example students completing an online enrolment form at a college need to select may options where the code is just an ID number from the database so without the description it is impossible to know what any of them mean.


With other browsers/browser engines if the code and description are the same (such as title: Mr, Mrs) then only the code is shown but where they differ then both are always displayed.


Data lists enhance usability as for long lists they make it much easier to find the corresponding option and I tend to add these to all drop-downs for consistency but on iPhone it has the opposite effect so I have to use JS to detect webkit and convert all data lists to select lists.


I used to do this for IE11 but shouldn't need to still do this for Safari in 2024.

I can't understand why it doesn't have proper support for this as a data list seems somewhat fundamental.

Apr 30, 2024 12:14 PM in response to -Bubba-

Thanks, I have submitted some feedback.


It would be good if they could fix it one day as it does seem like quite a limitation and it is the only one I am really aware of.


If you look at compatibility charts they tell you data lists are supported in Safari but when they don't show you what option you are selecting I can't really see how this could be called supported.


Data lists are more suited to longer lists of options where the code/ID is more likely to be meaningless as is the ID from the database.

Apr 30, 2024 12:18 PM in response to robinwilson16

Perhaps the issue here is that it is actually ok on Safari on a Mac as looking at your screenshots it looks ok on Mac so must only affect WebKit browsers on iOS but then that is still quite a chunk of users.


Should Safari not really render consistently between Mac Os and iOS and does this make it perhaps more like a long forgotten bug.


I'm surprised there are no more posts about it.

May 1, 2024 4:42 PM in response to Quadratechs

Hello


As far as I am aware data lists have never worked properly on iOS so I have to use some JavaScript manipulation to adapt the page to fall back to basic select lists in order to get them to show the descriptions for each option but then you lose the main benefit of a datalist which is that it searches the list and reduces the options as you type finding that word anywhere in the available options.


It's the same in 17.4.1 and also on a 17.5 beta device I have.


I used to have to do the workarounds for IE11 but I can't see why a modern browser in 2024 does not properly support the web standards ratified in 2011: https://www.w3.org/TR/2011/WD-html5-20110405/the-button-element.html#the-datalist-element

Datalist Support in Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.