diff --git a/addon/components/select-box/index.gjs b/addon/components/select-box/index.gjs index dea37a87..7f31ff20 100644 --- a/addon/components/select-box/index.gjs +++ b/addon/components/select-box/index.gjs @@ -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); @@ -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 diff --git a/tests/dummy/app/styles/example.scss b/tests/dummy/app/styles/example.scss index 772bac8f..666840b4 100644 --- a/tests/dummy/app/styles/example.scss +++ b/tests/dummy/app/styles/example.scss @@ -31,7 +31,6 @@ @mixin dropdown-content { display: flex; flex-direction: column; - overflow: auto; } @mixin options { diff --git a/tests/dummy/app/styles/example3.scss b/tests/dummy/app/styles/example3.scss index 108723eb..4de60468 100644 --- a/tests/dummy/app/styles/example3.scss +++ b/tests/dummy/app/styles/example3.scss @@ -27,6 +27,10 @@ height: 240px; } + .select-box__options { + @include example.options; + } + .select-box__option { @include example.option; } diff --git a/tests/dummy/app/styles/example4.scss b/tests/dummy/app/styles/example4.scss index 070e92ac..6300f504 100644 --- a/tests/dummy/app/styles/example4.scss +++ b/tests/dummy/app/styles/example4.scss @@ -27,6 +27,10 @@ height: 282px; } + .select-box__options { + @include example.options; + } + .select-box__option { @include example.option; } diff --git a/tests/integration/components/select-box/index/focus-test.gjs b/tests/integration/components/select-box/index/focus-test.gjs index 0db8a8e6..161ebd23 100644 --- a/tests/integration/components/select-box/index/focus-test.gjs +++ b/tests/integration/components/select-box/index/focus-test.gjs @@ -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(