Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for trigger promises to finish before save #4488

Merged
merged 1 commit into from Nov 14, 2017
Merged

Wait for trigger promises to finish before save #4488

merged 1 commit into from Nov 14, 2017

Conversation

pratu16x7
Copy link
Contributor

@pratu16x7 pratu16x7 commented Nov 14, 2017

Replicated via: WN-SUP28944

If save is clicked before blurring a trigger-calling field, the trigger may or may not finish before the save, resulting in the trigger affected fields not getting updated.

The proposed pattern will require the trigger on the field to return a Promise:

screen shot 2017-11-14 at 2 55 55 pm

This will cause save to wait for any leftover triggers (Also needs the freeze screen evidently):

triggers_on_save

@@ -696,7 +702,9 @@ _f.Frm.prototype.save = function(save_action, callback, btn, on_error) {

// let any pending js process finish
setTimeout(function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setTimeout was left as is for present implementation.

@rmehta
Copy link
Member

rmehta commented Nov 14, 2017

Looks fine.

@rmehta rmehta merged commit 3ff990c into frappe:develop Nov 14, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants