Bug 1885017 [wpt PR 45064] - Make clicking only selected option in multi-select deselect it, a=testonly

Automatic update from web-platform-tests
Make clicking only selected option in multi-select deselect it

This makes it so that if there is only a single option selected in a
<select multiple> element, clicking it will deselect it instead of
doing nothing.

This is to reduce user confusion about how to deselect options while
minimizing the impact on existing content, since the old do-nothing
behavior of this interaction is likely never a user's intention.

Bug: 327940247
Change-Id: If21cad16100155bc310745ca244ebf1dab0a691f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5360033
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1277858}

--

wpt-commits: 1a25adc1c9dda7890fbd008e69f524381e45724e
wpt-pr: 45064
This commit is contained in:
Psychpsyo 2024-03-27 23:08:52 +00:00 committed by moz-wptsync-bot
parent 7a76734005
commit 7ffc0da9f4

View File

@ -29,6 +29,7 @@ for (const writingMode of ["horizontal-tb", "vertical-lr", "vertical-rl", "sidew
select.style.writingMode = writingMode;
this.add_cleanup(() => {
select.removeAttribute("style");
select.value = "";
});
const elementBox = select.getBoundingClientRect();