Skip to content

Commit 4bd2b90

Browse files
committed
prevent firefox tab going to scrollable listbox as it disappears
1 parent 26883a6 commit 4bd2b90

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/combobox/combobox-select-only.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h2 id="ex_label">Example</h2>
5555
tabindex="0"
5656
>
5757
</div>
58-
<div class="combo-menu" role="listbox" id="listbox1">
58+
<div class="combo-menu" role="listbox" id="listbox1" tabindex="-1">
5959
<!-- options are inserted here -->
6060
<!-- e.g. <div role="option" id="op1">option text</div> -->
6161
</div>
@@ -276,7 +276,7 @@ <h3 id="rps_label_combobox">Combobox</h3>
276276
</th>
277277
<td></td>
278278
<td><code>div</code></td>
279-
<td>Identifies the input as a combobox.</td>
279+
<td>Identifies the element as a combobox.</td>
280280
</tr>
281281
<tr data-test-id="combobox-aria-labelledby">
282282
<td></td>
@@ -320,7 +320,7 @@ <h3 id="rps_label_combobox">Combobox</h3>
320320
<ul>
321321
<li>When an option in the listbox is visually indicated as having keyboard focus, refers to that option.</li>
322322
<li>When navigation keys, such as <kbd>Down Arrow</kbd>, are pressed, the JavaScript changes the value.</li>
323-
<li>Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the <code>input</code> element.</li>
323+
<li>Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the <code>combobox</code> element.</li>
324324
<li>
325325
For more information about this focus management technique, see
326326
<a href="../../#kbd_focus_activedescendant">Using aria-activedescendant to Manage Focus.</a>

examples/combobox/js/select-only.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ Select.prototype.selectOption = function(index) {
326326
this.activeIndex = index;
327327

328328
// update displayed value
329-
const selected = this.options[index];
330-
this.comboEl.innerHTML = selected;
329+
this.comboEl.innerHTML = this.options[index];;
331330

332331
// update aria-selected
333332
const options = this.el.querySelectorAll('[role=option]');

0 commit comments

Comments
 (0)