ionic-team / ionic-team/ionic-framework

feat: Add event for ion-item-sliding open/close state change

オープン
#18,533 コメント 2 件 リアクション 4 件 担当者 0 名 GitHub で見る
package: core type: feature request
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

# Feature Request

**Ionic version:**

[x] **4.x**

**Describe the Feature Request**

Ionic should provide an event(s) for developers that allows them to determine when an `` has been fully opened or closed.

**Describe Preferred Solution**

Provide event(s) `ionOpen` and/or `ionClose` emitted when the slider reaches a fully open or closed position. It would only emit once even if the user has not removed their finger from the slider, but the slider has moved to an "open/closed" position.

For example, if the user moves the slider from position 0 to position 1.0, the event would fire once.

If the user moves the slider from position 0 -> 1 and back to 0, the event would fire twice (once on "open" and once on "close").

If the user moves the slider from position 0 -> 0.5 -> 0, the event would *not* fire (because there was not a change from open to closed or vice-versa.

**Describe Alternatives**

The current implementation allows developers to use the `ionDrag` event (https://ionicframework.com/docs/api/item-sliding#events), but that event emits any time the position changes and is not definitive (i.e. you could drag a slider halfway to open/closed and the event would still fire).

Alternatively you could also use the `getSlidingRatio` and set it to a specific value. However, this is also not definitive as you could drag from 0 -> 0.75 -> 0 which should not count as a close/open.

**Related Code**

I do not have a code sample at this time.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。