Promises in my datasets’ onReady() , onBeforeSave() and onAfterSave() are fulfilled once the page has finished loading, for example, I want to scroll to somewhere after the user submits a form, and update a database before submitting another form, but the page scrolls immediately once the page finish loading and update the databse immediately too, I did notice this because the “updated time” on the repeater’s element has changed.
Why is this happening? And how can I prevent it?
Notice the following page, the review update date will automatically change each and every time you reload the page, the on before and on after save functions are only checked when the user is logged in: Visit the page .
Hi Shan,
Thanks for your reply. Yes I’m aware of the use of the async/await , and I’m using them along with the .then() , my problem is that some promises inside the onAfterSave() and the onBeforeSave() are executed automatically, for example, a box must show after save, and a scroll is should be done before save, but once the page loads, the box is shown and the page scrolled although non of their conditions were fulfilled.