BRACKETS-by-TRIAD / craftable

Admin panel builder / CRUD generator for Laravel.
https://getcraftable.com
MIT License
984 stars 191 forks source link

Vue watchers are nullifying my form textboxes #351

Closed GonrasK closed 3 years ago

GonrasK commented 3 years ago

Hello. I've added some extra functionality to the admin dashboard and added 'translate' button to every translatable field, which uses the DeepL translation API.

Screen Shot 2021-07-19 at 16 32 52

The translations themselves work just fine, but there is some Vuejs background watcher which returns the form to its' original state and removes my translated strings from the textboxes..It happens once I manually type something in the other textboxes and/or hit the 'Save' button.

I debugged it and found out that the admin.js is indeed watching for changes in the UI, and it starts here - Screen Shot 2021-07-19 at 16 35 38

And once it reaches the flushCallbacks() function (in the screenshot below) - it basically returns my form to its' "default" state (with the original DB values, if there are) before the translations were inserted into their textboxes.

Screen Shot 2021-07-19 at 16 36 55

I tried disabling the watcher on 'input' and 'submit' events, but now it results in 419 error on the laravel side.

GonrasK commented 3 years ago

Here's a short video of the behaviour that I tried to describe ..

https://user-images.githubusercontent.com/30444072/126171516-fa70fa4c-7e65-4411-ae7c-d837e16efe6b.mov