Updating resets edit input
- Langage dominant
- TypeScript
- Étoiles
- 1.6k
- Forks
- 867
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
There is a resume of my issue at the end.
The data I am displaying in my table is pulled from our Firebase, which communication is handled by angularfire2, and is synced to it via a subscription(source loads info whenever there is a change to the database), making display real-time.
The issue I am running into is if I am currently editing a row and someone else updates the database, causing the table to reload, whatever input was there is lost and this can lead to some pretty frustrating scenarios.
I have tried working around it by using update and append rather than load, by adding appending the first entry to the table regardless, and then from now and on checking source.data's entries for the ID - if there is a match then it updates that entry, otherwise it will append the new piece of data. This did not work as expected as it would still cancel out editing.
I had thought of suspending the subscription if ng-reflect-is-in-editing="true" is present in the inner HTML, but that would mean that if the user leaves editing open then he won't see any changes.
I have spent quite a lot of time doing research on this and trying to make it work by myself but I couldn't find anything related to it nor was I able to get it to work, so I figured I'd ask here.
Resume - I'd like to know if there is a way to not lose my edition when the table is updated by either load, append or update.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.