Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: long action sheet with safe area pushes cancel button off screen #27777

Closed
3 tasks done
wsamoht opened this issue Jul 11, 2023 · 2 comments · Fixed by #28504
Closed
3 tasks done

bug: long action sheet with safe area pushes cancel button off screen #27777

wsamoht opened this issue Jul 11, 2023 · 2 comments · Fixed by #28504
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@wsamoht
Copy link

wsamoht commented Jul 11, 2023

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

It appears starting in Ionic 7, the Cancel button for the IonActionSheet and IonSelect (with interface "action-sheet") is being pushed off screen when there is --ion-safe-area-top set.

image

Expected Behavior

I would expect the Cancel button to be fixed at the bottom and fully visible.

Steps to Reproduce

Steps

  1. Create an ion-action-sheet (with a Cancel button) or ion-select (with interface=action-sheet) with enough items to force a scroll
  2. Set --ion-safe-area-top

Code Reproduction URL

Stackblitz examples

Ionic Info

Ionic:

   Ionic CLI       : 7.1.1
   Ionic Framework : @ionic/vue 7.1.2

Capacitor:

   Capacitor CLI      : 4.8.1
   @capacitor/android : 4.8.1
   @capacitor/core    : 4.8.1
   @capacitor/ios     : 4.8.1

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.2

System:

   NodeJS : v18.12.1
   npm    : 8.19.2
   OS     : Linux 5.15

Additional Information

This is affecting both Android and iOS.

@ionitron-bot ionitron-bot bot added the triage label Jul 11, 2023
@liamdebeasi liamdebeasi self-assigned this Jul 11, 2023
@liamdebeasi liamdebeasi changed the title bug: action-sheet Cancel button off screen when --ion-safe-area-top set bug: long action sheet with safe area pushes cancel button off screen Jul 11, 2023
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Jul 11, 2023
@ionitron-bot ionitron-bot bot removed the triage label Jul 11, 2023
@liamdebeasi liamdebeasi removed their assignment Jul 11, 2023
@liamdebeasi
Copy link
Contributor

Thanks, I can reproduce this. As a temporary workaround you can set --height: 100%, though note that the content will take slightly longer to appear on animate in due to the increase height on the inner wrapper element.

github-merge-queue bot pushed a commit that referenced this issue Nov 13, 2023
#28504)

Issue number: fixes #27777

---------

## What is the current behavior?
When safe area (top/bottom) is applied to an action sheet with
scrollable options and a cancel button, the cancel button is pushed off
the screen and cannot be reached.

## What is the new behavior?
Properly adjust the height of the action sheet container to account for
the top and bottom safe area.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

The below screenshots use the following CSS when safe area is added so
it is expected that the action sheet will adjust the top and bottom:

```css
:root {
  --ion-safe-area-top: 60px;
  --ion-safe-area-bottom: 40px;
}
```

### iOS

|                    | Before (`main`) | After (`FW-4715`) |
| -------------------| ----------------| ------------------|
| **No** Safe Area |
![ios-main-no-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/2bbb8c09-6e35-4f88-983c-019cef1b9f44)
|
![ios-branch-no-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/55d899d3-945e-4d1e-983f-5d9b0a3ad6cc)
|
| **Safe Area** |
![ios-main-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/7b7ea64c-4432-4160-aadb-8be333549bc6)
|
![ios-branch-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/02143b3a-ca40-4294-b77c-3bb7867da0b9)
|

### Material Design

|                    | Before (`main`) | After (`FW-4715`) |
| -------------------| ----------------| ------------------|
| **No** Safe Area |
![md-main-no-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/a448bd22-6d79-4f2c-a0ec-654c6679732f)
|
![md-branch-no-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/ef8244c4-b8e8-434b-bd06-1d6981396574)
|
| **Safe Area** |
![md-main-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/80e00ce6-eb34-4d87-9546-a49da373fb6b)
|
![md-branch-safe-area](https://github.com/ionic-team/ionic-framework/assets/6577830/d8b86141-a65c-4026-b895-8d167ebc6258)
|

---------

Co-authored-by: ionitron <[email protected]>
Copy link

ionitron-bot bot commented Dec 13, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants