Conversation
Issue number: resolves #28541
What is the current behavior?
On iOS when dismissing the ion-action-sheet, the animation does not account for the safe area of the device. This results in the action sheet not completely animating off the visible viewport on a device with safe area enabled.
What is the new behavior?
- The
ion-action-sheetwill animate consistently off the viewport when dismissing, including the safe area.
To better support custom animations not needing to account for the safe area, the safe area has been added to the padding of the action sheet container. This results in the height increasing based on the bottom safe area and animating correctly when translating between 100% and 0%.
| Before | After |
|---|---|
| Kapture.2024-02-01.at.18.08.14.mp4 | Kapture.2024-02-01.at.18.05.06.mp4 |
In the recorded examples the bottom safe area is exaggerated to show the dismiss animation differences.
Does this introduce a breaking change?
- Yes
- No
Other information
To test this PR, I would recommend adding the following styles to the action sheet basic test:
<style> ion-action-sheet { --ion-safe-area-bottom: 100px; } </style>
You can then open dev-tools and slow the animation speed to 10%:
- Open and dismiss the action sheet tied to the "Basic" button.
- Verify that the action sheet animates completely off the view when dismissed.
- Open the and dismiss the action sheet tied to the "Custom CSS Class" button. This implementation customizes the
--heightof the action sheet. - Verify that the action sheet animates completely off the view when dismissed.
