Show loading spinner until share settings are fully loaded #38163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The inputs of the sharing settings are generated in a template in the server, but the listeners to react to changes in the elements and save the values in the server are loaded in the client once the DOM finishes loading. If the DOM takes long to load the user can start to interact with the settings before the listeners were set up and, therefore, the changes would not be saved in the server. However, as the inputs are modified the user would think that the changes were already saved.
To address that now when the sharing settings are open a loading spinner is shown instead of the contents of the sharing settings, and only once the listeners to save the changes were set up the spinner is removed and the contents shown.
How to test
Result with this pull request
A loading spinner is shown, which is removed once the settings were loaded
Result without this pull request
The sharing settings are immediately shown, so they can be modified, but if done too quickly after they are shown they are not saved to the server (which can be verified by reloading the page)