ember-stripe-elements icon indicating copy to clipboard operation
ember-stripe-elements copied to clipboard

uncaught TypeError: _this.change.apply is not a function

Open caltabid opened this issue 6 years ago • 2 comments

I also switched to "develop" branch for SCA and I think there is an error in addon/components/stripe-element.js, line 86: this.change(stripeElement, ...args); when I use it I get the error: "uncaught TypeError: _this.change.apply is not a function" Should it be called like the others this._invokeAction('change', stripeElement, ...args) ?

caltabid avatar Aug 30 '19 17:08 caltabid

With the above modification (this._invokeAction) there was no error but the action was not bubbled to my callback. Can this be related to the Ember version? I'm using Ember 2.18. I fixed this by reverting the code back to "this.sendAction" as implemented in the master branch.

caltabid avatar Aug 31 '19 12:08 caltabid

Hi! So I think it should be changed to this._invokeAction('change', stripeElement, ...args) as you say. Can you submit a PR for just that fix?

_invokeAction calls a closure action that you pass in... i.e it won't bubble. So you'd need to provide an action to the element rather than using bubbling... this is the same for all the other actions. The readme needs to be updated as it's out of date, plus we're planning on renaming them onChange etc to make it clearer that they are not actions that bubble - see #55

lindyhopchris avatar Sep 05 '19 07:09 lindyhopchris