mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-02-20 08:27:32 +08:00
The `_contentHeaderTopInset > _contentHeightSurplus` check in `MDCBottomDrawerContainerViewController`'s `cacheLayoutCalculationsWithAddedContentHeight:` function was erroneously evaluating to `true` when presenting content: - in full screen - with no header - with the content's height being equal to the available height Because of how `_contentHeightSurplus` is calculated, it was almost (but not quite) equal to `_contentHeaderTopInset`, which was causing the function to infinitely recurse. This PR also adds an example that demonstrates the issue. To reproduce: 1. Open MDCDragons 1. Navigate to the "Bottom Drawer No Header Less Content" example 1. Rotate the phone/simulator to landscape 1. Show the bottom navigation drawer by tapping on the menu icon Expected: The bottom drawer is displayed. Actual: The `cacheLayoutCalculationsWithAddedContentHeight:` infinitely recurses and the app crashes due to stack overflow. Closes #7633