Closed sergiocruz closed 5 years ago
Good question!
The way I've used it in the past is to not use the built in event attachment, but to use the utility functions to handle the input changes, formatting, and validation in a more "React Way".
That is not to say we'd be opposed to an API that helps to detach events!
Seems like a good idea to me. 👍
I don't see any outstanding issues with this as well!
Thanks for getting back to me so quickly @jondavidjohn and @ddayguerrero! I went ahead and created a PR allowing us to detach events from the input fields. Please let me know if you would have done it any differently, etc.
The PR I am referring to is #62 just in case. Thanks again!
Hello there! I started using payform today and thanks for all the hard work that has been put into this so far, it's really good!
I'm using the library in an SPA environment (React), and I've noticed that there is no way to detach event listeners from elements before removing them from the DOM.
Is this something that has been discussed before? I'm happy to take a stab at opening a PR for adding a couple of new methods to the payform API but I wanted to run it by you first to see if the interest was there and what kind of approach you'd prefer.
Thanks!
EDIT: To clarify, I'm currently using this:
payform.cardNumberInput(input)