|
142 | 142 | eventList = [];
|
143 | 143 |
|
144 | 144 | // Click on an option, with preventDefault
|
145 |
| - wrapper.addEventListener('click',(e) => e.preventDefault(),{once:true}); |
| 145 | + wrapper.addEventListener('mouseup',(e) => e.preventDefault(),{once:true}); |
146 | 146 | assert_equals(select.selectedOptions[0].innerText,'two');
|
147 | 147 | await test_driver.click(option1);
|
148 | 148 | assert_true(select.matches(':open'),'click should be cancelled');
|
149 | 149 | assert_events([
|
150 | 150 | 'pointerdown on option1 at select', 'pointerdown on option1 at wrapper',
|
151 | 151 | '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' |
153 | 157 | ],'click option, with preventDefault');
|
154 | 158 |
|
155 | 159 | // Click on an option, no preventDefault
|
|
159 | 163 | assert_events([
|
160 | 164 | 'pointerdown on option1 at select', 'pointerdown on option1 at wrapper',
|
161 | 165 | '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', |
163 | 168 | 'input on select at select', 'input on select at wrapper',
|
164 | 169 | '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' |
167 | 171 | ],'click option, no preventDefault');
|
168 | 172 | },`Events, ${wrapper.dataset.description}`);
|
169 | 173 | });
|
|
0 commit comments