Fix summary & description fields deleting user's text (sometimes) after a commit #11345
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.
Closes #7251
Description
This PR tackles a problem where the component
CommitMessage
could clear the summary and description textfields a few seconds after the commit completed, when the user might already have written something for their next commit.The problem was
CommitMessage
relied on therepository.state.isCommitting
attribute to enable/disable the textfields, but wouldn't clear the textfields until the commit + some additional tasks were finished. So the timeline would look something like this:repository.state.isCommitting = true
(textfields are now disabled)repository.state.isCommitting = false
(textfields are now enabled)This bug surfaces when step (4) takes too long, which is when the user might be preparing their next commit message, just to see how it gets deleted in step (5).
With this PR, the timeline of events looks like this:
repository.state.isCommitting = true
(textfields are now disabled)repository.state.isCommitting = false
(textfields are now enabled)Now the the textfields will be cleared right after enabling them again.
Release notes
Notes: [Fixed] Commit messages won't be cleared while the user is writing them.