Skip to content

Commit

Permalink
fix internal order of options when used with #in-element
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Jan 21, 2025
1 parent a8599eb commit 6e46e4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 17.1.1

- Fix internal order of options when used with `#in-element`

## 17.1.0

- Add `@destination` argument to dropdown content
Expand Down
4 changes: 3 additions & 1 deletion addon/components/select-box/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ export default class SelectBox extends Component {
}

get optionElements() {
return [...this.element.querySelectorAll('.select-box__option')];
return this.optionsElement
? [...this.optionsElement.querySelectorAll('.select-box__option')]
: [];
}

get interactiveElement() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module('select-box (in-element)', function (hooks) {
const destination = () => find('.destination');

test('a common scenario of rendering a dropdown in an external element works', async function (assert) {
assert.expect(6);
assert.expect(7);

await render(<template>
{{! template-lint-disable no-unnecessary-curly-strings }}
Expand Down

0 comments on commit 6e46e4b

Please sign in to comment.