Skip to content

Commit

Permalink
fix(Button): reset should not change state multiple times in one ru…
Browse files Browse the repository at this point in the history
…nloop

If passing a annonymous function to `scheduleOnce` it won't match:
https://emberjs.com/api/ember/3.2/functions/@ember%2Frunloop/scheduleOnce

Funny enough `resetState` method was not used before at all.
  • Loading branch information
jelhan committed Aug 4, 2018
1 parent ccbd517 commit 1e6e05d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions addon/components/base/bs-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ export default Component.extend(TypeClass, SizeClass, {

resetObserver: observer('reset', function() {
if (this.get('reset')) {
scheduleOnce('actions', this, function() {
this.set('state', 'default');
});
scheduleOnce('actions', this, 'resetState');
}
}),

Expand Down

0 comments on commit 1e6e05d

Please sign in to comment.