Skip to content

Commit 7fc170c

Browse files
Sean Perkinsmanucorporat
authored andcommitted
fix(ion-reorder-group): adds ionItemReorder event
fixes #14640
1 parent f9bf5c0 commit 7fc170c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/src/components/reorder-group/reorder-group.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Element, Prop, QueueApi, State, Watch } from '@stencil/core';
1+
import { Component, Element, Event, EventEmitter, Prop, QueueApi, State, Watch } from '@stencil/core';
22

33
import { Gesture, GestureDetail } from '../../interface';
44
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/haptic';
@@ -41,6 +41,8 @@ export class ReorderGroup {
4141
}
4242
}
4343

44+
@Event() ionItemReorder!: EventEmitter;
45+
4446
async componentDidLoad() {
4547
const contentEl = this.el.closest('ion-content');
4648
if (contentEl) {
@@ -62,6 +64,7 @@ export class ReorderGroup {
6264
onMove: this.onMove.bind(this),
6365
onEnd: this.onEnd.bind(this),
6466
});
67+
6568
this.disabledChanged();
6669
}
6770

@@ -192,6 +195,10 @@ export class ReorderGroup {
192195
setTimeout(reorderInactive, 200);
193196
} else {
194197
reorderInactive();
198+
this.ionItemReorder.emit({
199+
from: fromIndex,
200+
to: toIndex
201+
});
195202
}
196203

197204
hapticSelectionEnd();

0 commit comments

Comments
 (0)