fix(bottom-sheet): not moving focus to container if autoFocus is disabled and focus was moved while animating #16418
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.
These changes incorporate #16297 and #16221 into the bottom sheet since it follows a similar focus capturing behavior to
MatDialogContainer
. They ensure that focus is on the bottom sheet container when the animation is over, because it could've moved while we were animating. It also has an extra check to ensure that we don't move focus unnecessarily if the consumer decided to move focus themselves somewhere within the bottom sheet.Note: does not include a unit test, because we need to be able to flush a
Promise.resolve
and an animation in a specific sequence, however the testing utilities flush them all at the same time.