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: stacked cancel button should appear last in ios alert #26367

Open
6 of 7 tasks
yudateNoriyuki opened this issue Nov 29, 2022 · 3 comments
Open
6 of 7 tasks

bug: stacked cancel button should appear last in ios alert #26367

yudateNoriyuki opened this issue Nov 29, 2022 · 3 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@yudateNoriyuki
Copy link

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When button names are long, the order of alert buttons in iOS is the reverse of that in Android.

Expected Behavior

The order of iOS should be the same as Android.

Steps to Reproduce

  1. I see an alert for https://ionicframework.com/docs/ja/api/alert#buttons
  2. Edit the html and name the 'Cancel' button 'CancelCancel (Buttons are aligned vertically)
  3. Compare iOS and MD.

iOS

image

MD

image

Code Reproduction URL

No response

Ionic Info

Additional Information

plz look at

MD

https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/alert/alert.md.vars.scss#L122

iOS

https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/alert/alert.ios.vars.scss#L129

The differences in properties affect this sort order.

@ionitron-bot ionitron-bot bot added the triage label Nov 29, 2022
@liamdebeasi liamdebeasi self-assigned this Nov 29, 2022
@liamdebeasi
Copy link
Member

Thanks for the report. I can reproduce this behavior.

For stacked buttons in Material Design alerts, the confirming action should appear above the cancelling action: https://www.material.io/components/dialogs#anatomy (See "Stacked full-width buttons" at the bottom). This is what is happening right now in Ionic: https://stackblitz.com/edit/angular-h8ajiu?file=src%2Fapp%2Fexample.component.ts,src%2Fapp%2Fexample.component.html

For stacked buttons in iOS alerts, the cancelling action should always appear last. The non-cancelling actions appear in the order they were passed. Here is an example of native iOS:

image

Related Swift UI code:

.alert("Important message", isPresented: $showingAlert) {
  Button("Cancel Cancel", role: .cancel) { }
  Button("Regular Button") { }
  Button("Delete Delete", role: .destructive) { }
}

This is different from inline buttons where the cancelling action should always appear first.


To summarize, we need to make the following change:

  1. Stacked buttons on iOS should always render the "cancel" button last. All other buttons should render the order in which they were presented.

@liamdebeasi liamdebeasi changed the title bug: The order of the alert buttons on iOS is reversed bug: stacked cancel button should appear last in ios alert Nov 29, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Nov 29, 2022
@liamdebeasi liamdebeasi removed their assignment Nov 29, 2022
@yudateNoriyuki
Copy link
Author

@liamdebeasi
Thanks for the reply.
If I keep waiting, will the iOS stack button be fixed?

@liamdebeasi
Copy link
Member

We are interested in fixing this issue. However, I do not have a timeline of when it will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants