-
Notifications
You must be signed in to change notification settings - Fork 719
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
[Feature Request] Add onChange callback #46
Comments
Jk. I figured it out. attaching the event listener in the onLoad like so
|
@carylgaskell does your event listener trigger on each keystroke? As far as I can tell. A user can click into the editor and start typing and the 'design:updated' listener does not trigger. If the user clicks out of the iframe, it triggers. There used to be a bunch of different listeners, and one of them (not sure which) would trigger the call back on each keystroke if someone were typing into the iframe. It was convenient, because, like you, i needed to know when the form was 'dirty'. In lieu of that, I added an event listener to tell me when the user clicks into the iframe, which assumes that they will start typing once they click, which is not entirely ideal.
|
Here is a sample, with on change and load existing design. |
I'm using the builder along with some other text fields as a "form" but in order to determine if the form is dirty I'd need to know if an update to the builder occurred. It would be great to expose an onChangeCallback prop. I'm sure others would want to use it to save changes automatically without clicking a button.
Thanks and great work!
The text was updated successfully, but these errors were encountered: