Reactivity Issue #16212
Unanswered
mr-Sepi0l
asked this question in
General - Components / Directives / etc
Reactivity Issue
#16212
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey There,
I migrate my app recently from vue 3 to Quasar and facing a quite odd issue.
After hours of searhcing and debugging, I was able to find out that it is caused by some unexpected reactivity.
Here is the case:
I have a Form class which handles all my forms.
I have a modal which contains a form with 2 fields a name and a color. Compenent is working and updating the entity.
The problem is, whenever I click the submit button, my form fields reset to default before the xhr request even finish. (So user see form fields changes to old values before the modal toggle off).
Let's say I have by default a #000 color on my entity and change it to #fff. When i press submit the value come back to #000.
(As i show the color in the input background, user notices it for sure).
After hours of investigations, I found out that the
this.isLoading = truein myForm.submitmethod trigger that reset. I'm almost sure it is related to reactivity. Updating a node in my form class make the whole object reset (But when I send it it contains the right data).Another point which is suprising is that when I
console.log(this)before and after the linethis.IsLoading = truethe preview dump shows right results but when unfold the data in console it shows default data. I'm a bit confused on how to fix that issue...Here is my module file:
And finally here is my component, simple modal form
All reactions