This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Currently the spec doesn't specify how Click() should work on a multi-select option. In Chrome and Firefox, they perform a toggle instead of a click command. This means the option that has been "clicked" actually just toggles that option on/off. In Edge an actual click happens, which in a multi-select means the same element is clicked and the selection is never cleared.
note: dom event discussion with select lists as well...
Chrome and Firefox are doing the Right Thing, IMO. "Click" is a "do what I mean" API.
I'm curious why Chrome/Firefox's implementation is thought to be the right thing? A user cannot reproduce what Chrome/Firefox do in this case. If a user clicks an item in a multi-select it selects that item. If they click it again it doesn't deselect that item. If the goal is to be true to what a browser/user would actually do/see when clicking a mouse on a multi-select then Firefox/Chrome wouldn't actually be doing what's right. Here is a jsfiddle example: https://jsfiddle.net/oxen65bj/ Click once: Selects that option Click same option 2nd time: Selects that option Ctrl + Click same option: Deselects that option Ctrl + Click other options: Selects those options in addition to the original option Shift + Click: Select a range from the currently selected option to the clicked option The appropriate way to deselect an option is to hold Ctrl and then Click the option you had selected. I would argue that this should be the approach. It would also offer other ways for users to do selections (seen above using Ctrl/Shift to select multiple). If one of the goals is to have WebDriver truly implemented as how the browser would do a click or send a key and fire events and such, I'd argue this is the route we should take. Otherwise we have a one-off functionality for clicking when it's a multi-select that doesn't actually do a click but instead some magic behind the scenes.