Skip to content

Commit 1f37c02

Browse files
josepharharmoz-wptsync-bot
authored andcommitted
Bug 1937180 [wpt PR 49684] - Make customizable select options listen to mouseup, a=testonly
Automatic update from web-platform-tests Make customizable select options listen to mouseup mouseup is better than mousedown because it allows the user to click and drag to choose an option like appearance:auto already does. More justification here: whatwg/html#10762 (comment) Change-Id: Ifa63d497b7dcfbc3d07e19d6a7850bddf57f78fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6077672 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Traian Captan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1396126} -- wpt-commits: 0c1d19546fd4873bb9f4147f0bbf868e7b4f91b7 wpt-pr: 49684
1 parent b98084e commit 1f37c02

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-events.tentative.html

+9-5
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,18 @@
142142
eventList = [];
143143

144144
// Click on an option, with preventDefault
145-
wrapper.addEventListener('click',(e) => e.preventDefault(),{once:true});
145+
wrapper.addEventListener('mouseup',(e) => e.preventDefault(),{once:true});
146146
assert_equals(select.selectedOptions[0].innerText,'two');
147147
await test_driver.click(option1);
148148
assert_true(select.matches(':open'),'click should be cancelled');
149149
assert_events([
150150
'pointerdown on option1 at select', 'pointerdown on option1 at wrapper',
151151
'mousedown on option1 at select', 'mousedown on option1 at wrapper',
152-
'click on option1 at select', 'click on option1 at wrapper',
152+
'focusout on option2 at select', 'focusout on option2 at wrapper',
153+
'focusin on select at select', 'focusin on select at wrapper',
154+
'pointerup on option1 at select', 'pointerup on option1 at wrapper',
155+
'mouseup on option1 at select', 'mouseup on option1 at wrapper',
156+
'click on option1 at select', 'click on option1 at wrapper'
153157
],'click option, with preventDefault');
154158

155159
// Click on an option, no preventDefault
@@ -159,11 +163,11 @@
159163
assert_events([
160164
'pointerdown on option1 at select', 'pointerdown on option1 at wrapper',
161165
'mousedown on option1 at select', 'mousedown on option1 at wrapper',
162-
'click on option1 at select', 'click on option1 at wrapper',
166+
'pointerup on option1 at select', 'pointerup on option1 at wrapper',
167+
'mouseup on option1 at select', 'mouseup on option1 at wrapper',
163168
'input on select at select', 'input on select at wrapper',
164169
'change on select at select', 'change on select at wrapper',
165-
'focusout on option2 at select', 'focusout on option2 at wrapper',
166-
'focusin on select at select', 'focusin on select at wrapper'
170+
'click on option1 at select', 'click on option1 at wrapper'
167171
],'click option, no preventDefault');
168172
},`Events, ${wrapper.dataset.description}`);
169173
});

0 commit comments

Comments
 (0)