lepikhinb / momentum-modal

MIT License
442 stars 26 forks source link

Problem with form in the modal body #42

Closed karloci closed 1 year ago

karloci commented 1 year ago

Hi, please, can you help me with this issue?

I have a modal with a form for creating a new user. Every time when I submit the form and get validation errors, the modal resets. Because of that, all inputs are empty and you must enter all data again. Also, I can't get errors for each input field from the "form" variable because errors are empty after resetting the form.

Also, when I submit the same form on the page (not in modal), everything works fine: the entered data remains and I get an array with validations errors.

I figured out that the modal is resetting after a few hours when I took a look at developers' tools on the "Elements" tag. I noticed that the modal element is shaded for a second after clicking on submit button, which means that some change has occurred on that element. I suppose that somehow modal is resetting and I don't know why.

Also, I downloaded the PingCRM example with modals and I check if there was any difference but it is almost the same as my code logic. There is nothing that will indicate the issue and I don't know which part of my code should I attach, but, if you have an idea and need some specific part of the code, please let me know!

karloci commented 1 year ago

I don't know why, but today when I started my application everything worked perfectly! I didn't make any changes during the night and now it works.