Skip to content

feat: expandable option should not snap back immediately on gesture release #27794

Open
@darrylnoakes

Description

@darrylnoakes

Prerequisites

Ionic Framework Version

v6.x

Current Behavior

The docs for ion-item-sliding state the following:

Options can be expanded to take up the full width of the item if you swipe past a certain point. This can be combined with the ionSwipe event on the item options to call a method when the item is fully swiped.

The ion-item-options docs further state that ionSwipe is "emitted when the item has been fully swiped."

However, I am seeing none of this behavior, at least not as I expect.

On the other hand, the ion-item-option docs states of the expandable attribute that, "if true, the option will expand to take up the available width and cover any other options," which seems to be subtly different, and pretty much what the actual behavior is.


Currently, an item will never stay expanded. After releasing the extra swipe, the expanded item instantly snaps back to normal width.

Also, the ionSwipe event is triggered after very little extra distance has been covered; hardly "fully swiped" by any means.

Expected Behavior

I expect the expanded option to expand to the full width of the item and stay like that.
I expect the ionSwipe event to only be fired once this has happened.

Steps to Reproduce

  1. Create a page with the example code in the docs on expandable options
  2. Optional: attach an ionSwipe listener to the ion-item-options and log calls.
  3. Try to expand the item.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI       : 6.16.3 (C:\Users\Darryl\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework : @ionic/vue 6.7.5

Utility:

   cordova-res : not installed globally
   native-run  : not installed globally

System:

   NodeJS : v18.15.0 (C:\Users\Darryl\AppData\Local\Volta\tools\image\node\18.15.0\node.exe)
   npm    : 9.5.0
   OS     : Windows 10

Actually Windows 11.

Additional Information

Relevant/potentially relevant issues:

Video of reproduction:

Screen_Recording_20230713_103818_Chrome.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions