Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: IonItemSliding open() method not working #25963

Closed
4 of 7 tasks
npearson72 opened this issue Sep 18, 2022 · 2 comments
Closed
4 of 7 tasks

bug: IonItemSliding open() method not working #25963

npearson72 opened this issue Sep 18, 2022 · 2 comments
Labels
ionitron: needs reproduction a code reproduction is needed from the issue author

Comments

@npearson72
Copy link

npearson72 commented Sep 18, 2022

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

The close method seems to work, but the open method does not. Here is an example of using the close method:

const handleSlide = async (event: any) => {
    const ratio = await event.target.getSlidingRatio();

    if (ratio >= 3) {
      await event.target.close();
    }
  };

  return (
    <IonItemSliding onIonDrag={handleSlide}>
      <IonItem>Testing...</IonItem>

      <IonItemOptions side="end">
        <IonItemOption color="danger" expandable>
          <Icon icon="icons8:trash" className="icon" />
        </IonItemOption>
      </IonItemOptions>
    </IonItemSliding>
  );

Here is the behavior:

close

Works as expected.

But when I change to the open method, it does not work.

const handleSlide = async (event: any) => {
    const ratio = await event.target.getSlidingRatio();

    if (ratio >= 3) {
      await event.target.open();
    }
  };

  return (
    <IonItemSliding onIonDrag={handleSlide}>
      <IonItem>Testing...</IonItem>

      <IonItemOptions side="end">
        <IonItemOption color="danger" expandable>
          <Icon icon="icons8:trash" className="icon" />
        </IonItemOption>
      </IonItemOptions>
    </IonItemSliding>
  );

Here is the behavior:

open

As you can see, when I drag past the 30% mark, nothing happens.

I would expect it slide open.

PS: I’ve also tried with open('end') and open('start') but nothing.

Expected Behavior

I would expect that once the open method is invoked, the IonItemSliding slides open completely.

Steps to Reproduce

Please see what I posted in the "Current Behavior" section.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI : 6.20.1

Utility:

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

System:

   NodeJS : v16.15.1
   npm    : 8.11.0
   OS     : macOS Monterey

Additional Information

I've also posted in the community forum:

https://forum.ionicframework.com/t/ionitemsliding-open-method-not-working/226975

@ionitron-bot ionitron-bot bot added the triage label Sep 18, 2022
@liamdebeasi liamdebeasi added the ionitron: needs reproduction a code reproduction is needed from the issue author label Sep 19, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 19, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Sep 19, 2022
@amandaejohnston
Copy link
Contributor

This issue is being closed due to insufficient reproduction. If this is still a problem in the latest version of Ionic, please open a new issue and ensure the template is fully filled out. Thank you!

@amandaejohnston amandaejohnston closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2022
@ionic-team ionic-team locked and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: needs reproduction a code reproduction is needed from the issue author
Projects
None yet
Development

No branches or pull requests

3 participants