Skip to content

Commit

Permalink
fixup! Release 17.0.0-6
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Dec 11, 2024
1 parent d4b2a03 commit aa9d140
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
10 changes: 0 additions & 10 deletions addon/components/select-box/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,6 @@ export default class SelectBox extends Component {
this._ensureFocus();
}

@action
handleFocusOut() {
if (this.dropdown) {
return;
}

this._forgetActiveOption();
}

@action
handleKeyDownTrigger(event) {
this._handleKeyDown(event);
Expand Down Expand Up @@ -671,7 +662,6 @@ export default class SelectBox extends Component {
data-disabled="{{this.isDisabled}}"
{{on "mouseleave" this.handleMouseLeave}}
{{on "mousedown" this.handleMouseDown}}
{{on "focusout" this.handleFocusOut}}
{{lifecycle
onInsert=this.handleInsertElement
onDestroy=this.handleDestroyElement
Expand Down
12 changes: 4 additions & 8 deletions tests/integration/components/select-box/index/focus-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -591,15 +591,9 @@ module('select-box (focus)', function (hooks) {
);
});

test('focus out listbox forgets active option', async function (assert) {
test('focus out does not forget active option', async function (assert) {
assert.expect(2);

// We only show the active option when the select box has focus,
// because it is receptive to user input and therefore can
// be selected. When not focused, there is no need for it.
// This is the equivalent of when a select box with a dropdown
// (a combobox) is closed.

await render(<template>
<SelectBox as |sb|>
<sb.Options>
Expand All @@ -620,7 +614,9 @@ module('select-box (focus)', function (hooks) {

await blur('.select-box__options');

assert.dom('.select-box__option[aria-current="true"]').doesNotExist();
assert
.dom('.select-box__option:nth-child(2)')
.hasAttribute('aria-current', 'true');
});

test('keyboard-focusable-scrollers fix', async function (assert) {
Expand Down

0 comments on commit aa9d140

Please sign in to comment.