fix(reorder-group): add children fallback for framework compatibility (#30593)

Issue number: resolves #30592

---------

## What is the current behavior?
Reorder group is failing for Angular, React & Vue due to the change from
`children` to `__children`.

## What is the new behavior?
- Fallback to `children` if `__children` is undefined.
- Adds an e2e test for Angular (depends on
https://github.com/ionic-team/ionic-framework/pull/30594)
- Tasks have been created to migrate and add e2e tests for the other
frameworks

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

Dev build: `8.7.2-dev.11754087334.1815cf22`

---------

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
Brandy Smith
2025-08-05 10:27:18 -04:00
committed by GitHub
parent 05026c5a48
commit 1cd81b9230
11 changed files with 218 additions and 3 deletions

View File

@ -19,6 +19,7 @@ export const routes: Routes = [
{ path: 'providers', loadComponent: () => import('../providers/providers.component').then(c => c.ProvidersComponent) },
{ path: 'overlay-controllers', loadComponent: () => import('../overlay-controllers/overlay-controllers.component').then(c => c.OverlayControllersComponent) },
{ path: 'button', loadComponent: () => import('../button/button.component').then(c => c.ButtonComponent) },
{ path: 'reorder-group', loadComponent: () => import('../reorder-group/reorder-group.component').then(c => c.ReorderGroupComponent) },
{ path: 'icon', loadComponent: () => import('../icon/icon.component').then(c => c.IconComponent) },
{ path: 'split-pane', redirectTo: '/standalone/split-pane/inbox', pathMatch: 'full' },
{

View File

@ -28,6 +28,11 @@
Icon Test
</ion-label>
</ion-item>
<ion-item routerLink="/standalone/reorder-group">
<ion-label>
Reorder Group Test
</ion-label>
</ion-item>
</ion-list>
<ion-list>

View File

@ -0,0 +1,36 @@
import { Component } from "@angular/core";
import { IonItem, IonLabel, IonReorder, IonReorderGroup } from '@ionic/angular/standalone';
import { ReorderEndCustomEvent } from "@ionic/angular";
@Component({
selector: 'app-reorder-group',
template: `
<ion-reorder-group disabled="false" (ionReorderEnd)="onReorderEnd($event)">
<ion-item>
<ion-reorder slot="end"></ion-reorder>
<ion-label>Item 1</ion-label>
</ion-item>
<ion-item>
<ion-reorder slot="end"></ion-reorder>
<ion-label>Item 2</ion-label>
</ion-item>
<ion-item>
<ion-reorder slot="end"></ion-reorder>
<ion-label>Item 3</ion-label>
</ion-item>
</ion-reorder-group>
`,
standalone: true,
imports: [IonItem, IonLabel, IonReorder, IonReorderGroup]
})
export class ReorderGroupComponent {
onReorderEnd(event: ReorderEndCustomEvent) {
if (event.detail.from !== event.detail.to) {
console.log('ionReorderEnd: Dragged from index', event.detail.from, 'to', event.detail.to);
} else {
console.log('ionReorderEnd: No position change occurred');
}
event.detail.complete();
}
}