Open Bug 1479854 Opened 6 years ago Updated 2 years ago

Feature Request: Allow adding icons/images to <select> and <datalist> <option>s

Categories

(Core :: Layout: Form Controls, enhancement)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: aleksey.gladysh, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15 Steps to reproduce: 1. Create a <select> or <datalist> element 2. Put an image or SVG element or anything other than plain text into an <option> element 3. Replace the <select> element with a complex JavaScript control. Actual results: Images and icons don't work in <option> elements. In the best case scenario, developers will replace it with a list of <input type="radio"> elements, but even though with a fair bit of work, such a custom control may be made somewhat accessible on desktop, it still creates an inferior form flow experience on mobile in most cases. Expected results: Have a way to render icons/images in the options so that developers wouldn't have to resort to JavaScript based controls which tend to be bad for accessibility on mobile and desktop. No browser supports this yet. This is a feature proposal that I'm going to do for all browsers. Here's a discussion on WHATWG's GitHub about it. https://github.com/whatwg/html/issues/3596
This bug is an enhancement. With the information given, I am not able to reproduce or confirm it, but I will set this issue's component as (Core) Layout: Form Controls and let the developers decide whether this issue is valid and worth addressing. @aleksey.gladysh: Can you provide us with a complete test case (with exact steps to reproduce) so I could confirm it and supposedly verify it when it gets fixed? Thank you for your contribution!
Severity: normal → enhancement
Component: Untriaged → Layout: Form Controls
Flags: needinfo?(aleksey.gladysh)
Product: Firefox → Core
How would I go about making a test case for a proposed feature? Especially when the implementation of said feature is very much up in the air. I suppose if the solution is to render limited HTML within an <option> element, then the test code could look something like the following: <select name="animal"> <option><img src="puppy.svg"> Puppy</option> <option><img src="kitten.png"> Kitten</option> </select> The result would have the referenced images show up in the dropdown when it is open.
Flags: needinfo?(aleksey.gladysh)
Blocks: input-list
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.