From ea11b7ee44cad3f9277c6761d8f0aa874bab30fd Mon Sep 17 00:00:00 2001 From: Michael Asimakopoulos Date: Thu, 18 Apr 2019 00:13:41 +0300 Subject: [PATCH] docs(breaking): add ionDrag event arguments change (#17989) --- angular/BREAKING.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/angular/BREAKING.md b/angular/BREAKING.md index 0d7260cf1df..9c5fea5c4b9 100644 --- a/angular/BREAKING.md +++ b/angular/BREAKING.md @@ -783,6 +783,26 @@ The option component should now be written as an `ion-item-option`. Previously i The `getSlidingPercent` method has been renamed to `getSlidingRatio` since the function is returning a ratio of the open amount of the item compared to the width of the options. +### Arguments Changed + +The `ionDrag` event no longer gets the sliding item as an argument. It now takes an event with a property `details` which contains two properties `amount` and `ratio` reflecting the absolute and ratio values of the sliding action respectively. + +**Old Usage Example:** + +```typescript +dragged(item: ItemSliding) { + console.log(item.getSlidingPercent()); + console.log(item.getOpenAmount()); +} +``` + +**New Usage Example:** +```typescript +dragged(ev: { details: { amount: number, ratio: number } }) { + console.log(ev.details.ratio); + console.log(ev.details.amount); +} +``` ## Label