Skip to content

Commit

Permalink
fixup! Release 17.0.0-0
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Dec 10, 2024
1 parent e66847d commit 06be159
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/integration/components/dropdown/index/focus-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ module('dropdownx (focus)', function (hooks) {
assert.expect(2);

// we use do not employ any methods to prevent
// keyboard-focusable-scrollers from taking affect.
// keyboard-focusable-scrollers from taking affect
// this allows focus to move to the dropdown content
// when it is overflowing.

let event;

Expand Down
13 changes: 10 additions & 3 deletions tests/integration/components/select-box/index/focus-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ module('select-box (focus)', function (hooks) {
await render(<template>
{{! template-lint-disable no-forbidden-elements }}
<style>
.select-box__trigger:focus-visible { outline: 2px solid red; }
.dropdown__trigger:focus-visible { outline: 2px solid red; }
</style>
<SelectBox @value="foo" as |sb|>
<sb.Dropdown>
Expand Down Expand Up @@ -623,14 +623,20 @@ module('select-box (focus)', function (hooks) {
});

test('keyboard-focusable-scrollers fix', async function (assert) {
assert.expect(1);
assert.expect(2);

// we use tabindex="-1" on the listbox to prevent
// we use tabindex="-1" on the dropdown content to prevent
// keyboard-focusable-scrollers from stealing focus, but
// this has a down side of actually allowing the listbox
// to be focusable on click, so we must prevent that.
//
// https://issues.chromium.org/issues/376718258
// https://bugzilla.mozilla.org/show_bug.cgi?id=1930662
//
// here, when the primary interactive element is focused,
// and the user presses tab, we always want focus to move
// to the next interactive element. skipping the overflowing
// dropdown content.

let event;

Expand All @@ -651,6 +657,7 @@ module('select-box (focus)', function (hooks) {
await click('.select-box .dropdown__trigger');
await click('.select-box__options');

assert.dom('.dropdown__content').hasAttribute('tabindex', '-1');
assert.true(event.defaultPrevented);
});
});

0 comments on commit 06be159

Please sign in to comment.