Skip to content

(maint) avoid calling "onSelect" when the tab is already selected #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addon/components/ivy-tabs-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default class IvyTabsTabComponent extends Component {
select() {
const onSelect = this.args.onSelect;
if (
!this.isSelected &&
!this.isDestroying &&
!this.isDestroyed &&
typeof onSelect === 'function'
Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/controllers/dynamic-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export default class DynamicTabsController extends Controller {

@action
updateDynamicSelection(item) {
if (this.selection !== item) {
this.selection = item;
}
this.selection = item;
}

get checkedItems() {
Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/controllers/query-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export default class QueryParamsController extends Controller {

@action
updateQuerySelection(newValue) {
if (this.selection !== newValue) {
this.selection = newValue;
}
this.selection = newValue;
}
}