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: can slide item even without option buttons #5192

Closed
brandyscarney opened this issue Jan 25, 2016 · 4 comments
Closed

bug: can slide item even without option buttons #5192

brandyscarney opened this issue Jan 25, 2016 · 4 comments
Assignees
Labels
help wanted a good issue for the community
Milestone

Comments

@brandyscarney
Copy link
Member

If there is a *ngIf on a button in ion-item-options then when the ngIf evaluates to false you can still swipe the item and see an empty white space:

<ion-item-options>
  <button favorite (click)="addFavorite(slidingItem, session)" *ngIf="segment === 'all'"> 
    Favorite
  </button>
</ion-item-options>

& if you put it on the ion-item-options you can't slide at all even when it evaluates to true.

image:

screen shot 2016-01-25 at 3 49 55 pm

@adamdbradley adamdbradley added this to the 2.0.0-beta.2 milestone Feb 3, 2016
@adamdbradley adamdbradley added the help wanted a good issue for the community label Feb 11, 2016
@kamiua
Copy link

kamiua commented Mar 12, 2016

I had the same problem. As temporary fix you could remove if (!itemData.optsWidth) { check in item-sliding-gesture as it caches swiping offset. I'm not sure if that is correct fix to the associated bug as it may be not as efficient as possible.

@manucorporat
Copy link
Contributor

@brandyscarney I think this should be fixed in my PR. I will test more in detail.

@manucorporat manucorporat self-assigned this Jun 6, 2016
@manucorporat
Copy link
Contributor

manucorporat commented Jun 8, 2016

@brandyscarney @adamdbradley before finding a fix for this, I am not sure how an empty ion-item-options, should behave.

I agree, ion-item-options should be able to adapt at runtime if the buttons change, but an empty ion-item-options does not make a lot of sense.

Maybe it should be refactored to:

<ion-item-options *ngIf="segment === 'all'">
  <button favorite (click)="addFavorite(slidingItem, session)"> 
    Favorite
  </button>
</ion-item-options>

I think an empty ion-item-options should slide (with an elastic effect).

@brandyscarney
Copy link
Member Author

@manucorporat That makes sense actually. I swear at one point that didn't work...I imagine I would've tried that haha. I'm ok with moving the ngIf to the options element as a solution.

manucorporat added a commit to manucorporat/ionic that referenced this issue Jun 8, 2016
manucorporat added a commit to manucorporat/ionic that referenced this issue Jun 8, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted a good issue for the community
Projects
None yet
Development

No branches or pull requests

4 participants