laracasts / Lets-Build-a-Forum-in-Laravel

http://laracasts.com/series/lets-build-a-forum-with-laravel
914 stars 311 forks source link

Client side glitch on reply component #15

Open AngelinCalu opened 7 years ago

AngelinCalu commented 7 years ago

There is a small glitch in the interaction between the user and the app. When he will try to edit he's own reply, the cancel button is a bit misleading as he might think that he updated the reply even when clicking "Cancel"

Glitch

flashadvocate commented 6 years ago

This is caused by the v-model binding to the body variable, which gets updated immediately even if the user doesn't submit the change.

If you add a second variable originalBody you can keep track of the originally persisted content. Just be sure to update it if the user actually submits an edit