mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
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:
@ -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' },
|
||||
{
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user