Skip to content

Commit

Permalink
fix(ion-reorder-group): adds ionItemReorder event
Browse files Browse the repository at this point in the history
fixes #14640
  • Loading branch information
Sean Perkins authored and manucorporat committed Aug 29, 2018
1 parent f9bf5c0 commit 7fc170c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/components/reorder-group/reorder-group.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Element, Prop, QueueApi, State, Watch } from '@stencil/core';
import { Component, Element, Event, EventEmitter, Prop, QueueApi, State, Watch } from '@stencil/core';

import { Gesture, GestureDetail } from '../../interface';
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/haptic';
Expand Down Expand Up @@ -41,6 +41,8 @@ export class ReorderGroup {
}
}

@Event() ionItemReorder!: EventEmitter;

async componentDidLoad() {
const contentEl = this.el.closest('ion-content');
if (contentEl) {
Expand All @@ -62,6 +64,7 @@ export class ReorderGroup {
onMove: this.onMove.bind(this),
onEnd: this.onEnd.bind(this),
});

this.disabledChanged();
}

Expand Down Expand Up @@ -192,6 +195,10 @@ export class ReorderGroup {
setTimeout(reorderInactive, 200);
} else {
reorderInactive();
this.ionItemReorder.emit({
from: fromIndex,
to: toIndex
});
}

hapticSelectionEnd();
Expand Down

0 comments on commit 7fc170c

Please sign in to comment.