mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-14 08:45:20 +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:
@ -86,6 +86,10 @@ const routes: Array<RouteRecordRaw> = [
|
||||
path: '/components/range',
|
||||
component: () => import('@/views/Range.vue')
|
||||
},
|
||||
{
|
||||
path: '/reorder-group',
|
||||
component: () => import('@/views/ReorderGroup.vue')
|
||||
},
|
||||
{
|
||||
path: '/nested',
|
||||
component: () => import('@/views/RouterOutlet.vue'),
|
||||
|
@ -29,6 +29,9 @@
|
||||
<ion-item router-link="/navigation" id="navigation">
|
||||
<ion-label>Navigation</ion-label>
|
||||
</ion-item>
|
||||
<ion-item router-link="/reorder-group">
|
||||
<ion-label>Reorder Group</ion-label>
|
||||
</ion-item>
|
||||
<ion-item router-link="/routing" id="routing">
|
||||
<ion-label>Routing</ion-label>
|
||||
</ion-item>
|
||||
|
78
packages/vue/test/base/src/views/ReorderGroup.vue
Normal file
78
packages/vue/test/base/src/views/ReorderGroup.vue
Normal file
@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<ion-page>
|
||||
<ion-header :translucent="true">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Reorder Group</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content :fullscreen="true">
|
||||
<ion-reorder-group :disabled="false" @ion-reorder-end="onReorderEnd">
|
||||
<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>
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
IonButtons,
|
||||
IonBackButton,
|
||||
IonContent,
|
||||
IonHeader,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonPage,
|
||||
IonReorder,
|
||||
IonReorderGroup,
|
||||
IonTitle,
|
||||
IonToolbar,
|
||||
} from "@ionic/vue";
|
||||
import { defineComponent } from "vue";
|
||||
import type { ReorderEndCustomEvent } from "@ionic/vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonButtons,
|
||||
IonBackButton,
|
||||
IonContent,
|
||||
IonHeader,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonPage,
|
||||
IonReorder,
|
||||
IonReorderGroup,
|
||||
IonTitle,
|
||||
IonToolbar,
|
||||
},
|
||||
setup() {
|
||||
const 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();
|
||||
};
|
||||
|
||||
return {
|
||||
onReorderEnd,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user