Skip to content

<ion-item-options side="left"> appears on right side (Ionic4) #14293

Closed

Description

@ghybs

Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ ] 3.x
[X] 4.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request

Current behavior:

The <ion-item-options side="left"> buttons appear when swiping from right to left, as if the side attribute was ignored.
If another <ion-item-options> is present in the same <ion-item-sliding> element, all buttons are stacked on the right side.

Expected behavior:

Buttons in <ion-item-options side="left"> element should appear on the left, i.e. when swiping from left to right.

Steps to reproduce:

  1. Try swiping an item from left to right: nothing happens, even though some <ion-item-options side="left"> element(s) have been specified in code.
  2. Swipe an item from right to left: buttons appear, as if they had been specified with side="right"

Related code:
http://plnkr.co/edit/FsmXIxFOeAW4Z3MA3xHe?p=preview

<ion-item-sliding>
  <ion-item>
    <ion-label>Item with left options only</ion-label>
  </ion-item>
  <ion-item-options side="left">
    <ion-item-option onClick="favorite(item)">Favorite</ion-item-option>
    <ion-item-option color="danger" onClick="share(item)">Share</ion-item-option>
  </ion-item-options>
</ion-item-sliding>

Other information:

Occurs since @ionic/core version 0.2.2 and 4.0.0-alpha.1 (current)

Activity

  1. brandyscarney commented on Apr 11, 2018

    @brandyscarney
    Member

    Thanks for the issue! The values for side were renamed from left to start and right to end. I noticed we didn't have this included in the breaking changes so I added it here: https://github.com/ionic-team/ionic/blob/master/angular/BREAKING.md#item-options

    I noticed that updating these in your plunker is not fixing them, but this should be working on the next alpha release.

  2. added this to the milestone on Apr 11, 2018
  3. ghybs commented on Apr 11, 2018

    @ghybs
    ContributorAuthor

    Hi,

    Thank you for clearing things up!

    I will be happy to test it in the next release.
    For reference, here is an updated plunker with "start" and "end" values for side attribute:
    http://plnkr.co/edit/GlD85AB62QlFisudQ7Ep?p=preview

    BTW, I also noticed in the item-sliding component README that we still refer to "right side" and "swip[ing] from right to left", which I guess is reversed in RTL.

    I can submit a PR to make the wording more explicit, e.g.:

    By default, the buttons are placed on the "end" side. This means that options are revealed when the sliding item is swiped from end to start, i.e. from right to left in LTR, but from left to right in RTL. To place them on the opposite side, so that they are revealed when swiping to the opposite direction, set the side attribute to "start" on the ion-item-options element.

    Or maybe a table could be more suitable, as done in buttons component README for example?

  4. ghybs commented on Apr 11, 2018

    @ghybs
    ContributorAuthor

    which I guess is reversed in RTL.

    Looks like I was partially wrong:
    When direction is set to rtl, buttons are now placed on the other side (i.e. on the left, irrespective of the side attribute value for now), but the swiping direction to reveal them is still the same, i.e. you have to swipe from right to left, which reveals… nothing until you reach the far left of the screen, where buttons are now placed.
    http://plnkr.co/edit/PJRHOr91V9QNkMyn8NRt?p=preview

    Should I open a separate bug report for this?

  5. brandyscarney commented on Apr 11, 2018

    @brandyscarney
    Member

    @ghybs Good catch! If you'd like to create a PR I'd be happy to get it merged in. Whatever you think makes the most sense. I think a table would be helpful or we could link back to item options. Although that is currently outdated too. 😁

  6. ghybs commented on Apr 14, 2018

    @ghybs
    ContributorAuthor

    Hi,

    Just to confirm that with the brand new release 4.0.0-alpha.2, this now works indeed:
    http://plnkr.co/edit/GLKIUKHpGTM2JkchqTUU?p=preview
    Thanks a lot for the good work!

    However this still does not work in RTL.
    Opening a separate issue for that.

  7. ionitron-bot commented on Sep 1, 2018

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  8. locked and limited conversation to collaborators on Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions