Skip to content

Commit

Permalink
fixup! remove unused getter
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Jan 24, 2025
1 parent e984053 commit 18fb54b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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.2.0

- Remove `return false` from `@onSelect` as a means to close the dropdown. Prefer using the dropdown API directly.

## 17.1.6

- Change sorting algorithm again
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Required. Fired when a selection is made (that is, an option is clicked, or ente

#### `@onSelect`

Optional. Similar to `@onChange` but fires regardless as to whether the value changed or not. The return value controls whether or not the select box will close after the selection.
Optional. Similar to `@onChange` but fires regardless as to whether the value changed or not.

#### `@onSearch`

Expand Down
4 changes: 2 additions & 2 deletions addon/components/select-box/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ export default class SelectBox extends Component {
}

_handleSelected() {
const close = this.args.onSelect?.(this.api) ?? this.canAutoClose;
this.args.onSelect?.(this.api);

if (close) {
if (this.canAutoClose) {
this.dropdown.close(SELECTED);
}
}
Expand Down

0 comments on commit 18fb54b

Please sign in to comment.