Skip to content

fix(alert): render the cancel button last when buttons stack - #31872

Draft
thetaPC wants to merge 1 commit into
mainfrom
FW-7351
Draft

thetaPC wants to merge 1 commit into
mainfrom
FW-7351

Conversation

@thetaPC

@thetaPC thetaPC commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Issue number: resolves #26367


What is the current behavior?

When alert buttons stack, they render in the order they were passed, so a cancel button passed first ends up on top. The iOS Human Interface Guidelines place Cancel "at the bottom of a stack", and Material Design 2 says "Confirming actions appear above dismissive actions" for stacked buttons. In md, two buttons that wrap showed Cancel on top since #31130.

What is the new behavior?

  • When buttons stack (more than two, or two that wrap), buttons with role: "cancel" render last in ios and md. Other buttons keep the order they were passed.
  • The buttons are reordered in the DOM, so tab order matches what is on screen.
  • Inline buttons are unchanged.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Check Before After What to do and look for
ios, three buttons main branch Tap "Multiple Buttons (>2)". Cancel is at the bottom; Open Modal and Delete keep their order above it.
md, three buttons main branch Same as above.
Two buttons that wrap New case ios, md Tap "Confirm (long button text)". The buttons stack with Cancel at the bottom.
Tab order Any of the above Open the alert and press Tab. Focus moves through the buttons top to bottom.

When alert buttons stack, buttons with role "cancel" render last in ios and md, matching native iOS and the Material Design stacked layout. Inline buttons keep their order.
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Dec 5, 2026 3:57am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — b02692a6 Deployed Dec 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: stacked cancel button should appear last in ios alert

1 participant