-
Notifications
You must be signed in to change notification settings - Fork 96
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
Change button state before event process #1866
Change button state before event process #1866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the pull request template back into the PR description. Can you please fill it in, including ticking all of the checkboxes that apply? This will help you identify things that need to be done before this is ready to be reviewed (for example build the dist javascript).
Please also retarget this PR to the 2.3
branch so that it can be included as a patch release rather than waiting for the next minor release.
You may need to reset your commits after retargetting the PR.
I have also tested this locally and found two problems:
- Instead of swapping to the "loading" appearance, the button goes completely blank:
It only uses the full loading styling after thebeforesubmitform
stuff has finished.
An easy way to test this is to add asleep(5)
into thevalidate()
method of an elemental block, then make sure to edit the block before hitting save. - If an elemental block has a validation error, the button stays disabled forever.
To fix 1, probably you need to move everything in the To fix 2, I suspect the |
32c8250
to
8cd82d6
Compare
Previously, Save button remains as it is after clicking on it with api call in background. Now, we enabled loading UI on button when start processing
8cd82d6
to
6f1e8a2
Compare
Problem 2 from #1866 (review) is still happening. Did you test that scenario? |
This is not reproducing to me, can you please share the reproduction steps? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, works well locally. Thanks for taking the time to implement this fix.
Description
Save button does not show loading state when clicking on it. Instead it remains still for sometime and then shows loading state. This is due to event being fully processed before setting the loading class and disabling the button.
Manual testing steps
Issues
Pull request checklist