-
Notifications
You must be signed in to change notification settings - Fork 243
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/form change event #281
base: master
Are you sure you want to change the base?
Feature/form change event #281
Conversation
Hi @james2doyle! Thanks for this PR, I'm not opposed to adding this in, and thank you for the idea. I am wondering if you could help me understand how this event is beneficial/different from the existing |
Good point. I will check that. I'm actually using a schema to build my form. From what I can see in the docs, there isnt a way to add event listeners via the schema object. Am I mistaken? By listening for form |
@james2doyle correct, currently there is no way to bind events to inputs using schemas. Although thats a high priority feature in The <FormulateForm
:schema="yourSchema"
@input="inputHandler"
/> Additionally, I'm pretty sure you can already bind the change event by using the <FormulateForm
@change.native="changeHandler"
/> If there's a clear use case for one over the other then by all means (!), let’s get this merged — but if they functionally are the same or nearly the same, I'd rather just stick with one event so people don’t have competing concepts they need to learn. |
Ah ok. Thanks for the link! I am also using a render function so I'm doing lots of quirky things. Let me look into it and share an update when I find something |
Hmm there is some weird stuff going on here: https://codesandbox.io/s/vue-formulate-reproduction-template-forked-65lsp?file=/src/components/Reproduction.vue You can see that none of the changes fire on I should also note that the |
Ok I think I may have found a bug. Seems like when |
Any thoughts on this? I think this is still a bug as the test shows |
Yeah i agree. it looks kind of like a bug. Sometimes double events on the form are unavoidable byproducts of the input's model and the form's model syncing, but obviously this looks like it needs to be cleaned up. Feel free to look for a solution to it — probably makes sense to file a separate bug report issue too. Thanks! |
I am building a form builder that allows users to connect actions to inputs. Without the form emitting its
change
events, there is no way for me to react to updates in the form without relying on native DOM event listeners. Not ideal.This PR just adds
onChange
to the top levelform
element so when any of the children firechange
the top level form can emit those changes.