Repository navigation
Description
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:
When RTL (CSS rule direction: rtl) is applied on the page, <ion-item-options> buttons are correctly placed on the left when side is set to "end" (default) and right for "start".
However, the child <ion-item-option> item is not allowed to swipe to the correct direction:
- on
"end"(i.e. placed on the left), the item can still swipe only from right to left, like in LTR. - on
"start"(i.e. placed on the right), the item can still swipe only from left to right, like in LTR.
You have to swipe the entire item length to be able to see the buttons (which is impossible to achieve on a real device).
Expected behavior:
Swiping direction should be reversed in RTL
Steps to reproduce:
- Try to swipe one of the items that has sliding options (as written in the label).
- The swipe direction is incorrect regarding the buttons position and RTL.
- The buttons appear only after you swipe the entire item length, so they are correctly placed in respect to RTL, but swiping direction is incorrect.
Related code:
body {
direction: rtl;
}<ion-item-sliding>
<ion-item>
<ion-label>Item with "start" and "end" options</ion-label>
</ion-item>
<ion-item-options side="start">
<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-options side="end">
<ion-item-option onClick="unread(item)">Unread</ion-item-option>
</ion-item-options>
</ion-item-sliding>Other information:
Follows issue #14293
Activity
ghybs commentedon Apr 15, 2018
Hi,
FWIW, it looks like the
<ion-item-sliding>swiping direction does change with the HTML attributedir="rtl", but somehow the<ion-item-options>button position and the swiping direction do not match…So with current version there is somehow a workaround, by:
<html dir="rtl"><ion-item-sliding dir="ltr"><ion-item dir="rtl">'s (possibly on the<ion-item-option dir="rtl">'s as well?)Example: http://plnkr.co/edit/FTL6aGT1aJiPBgXciCxW?p=preview
manucorporat commentedon Apr 15, 2018
@ghybs unfortunately we can't support:
because there are not a CSS pseudo selector we can use:
https://caniuse.com/#feat=css-dir-pseudo
is the only possible solution until browser vendors implement the :dir() psudo selector
ghybs commentedon Apr 15, 2018
Hi,
Thank you for your message.
While it is true that my original message used the CSS rule for setting RTL direction, there is still an issue when using the
dir="rtl"HTML attribute:http://plnkr.co/edit/mp5X72AHkEDSgQRicW6v?p=preview
Instead of having the buttons on the correct position (i.e. reversed compared to LTR) but swiping incorrect (i.e. same as in LTR), the situation is now the opposite: swiping is indeed correct (i.e. reversed compared to LTR), but buttons are in their original position (i.e. same as in LTR)…
As shown in my message above, we can somehow workaround this inconsistency my "manually" playing with LTR and RTL values on the
<html dir="rtl">,<ion-item-sliding dir="ltr">and<ion-item dir="rtl">(http://plnkr.co/edit/FTL6aGT1aJiPBgXciCxW?p=preview), but I feel you would not like having developers resorting to such strange technique when advertising full RTL support…ghybs commentedon Apr 15, 2018
BTW setting the RTL value on the
<body>instead of<html>tag gives the same situation as originally reported: buttons are in expected position (i.e. on the right forside="start"and on the left forside="end", but swiping direction is the same as is LTR):http://plnkr.co/edit/AI1bloEY1KqDQwtdW8oS?p=preview
brandyscarney commentedon Apr 16, 2018
@AmitMY Any input on this? 🙂
AmitMY commentedon Apr 16, 2018
I discussed this with @manucorporat in greater length, but basically, yes, the current behavior has a problem, should rework that. The old PR fixed the swiping direction, but not buttons positions, and for that we still have #12154 (it's also in the RTL shared doc)
paulstelzer commentedon Jan 19, 2019
I close this here because @abennouna has a nice list of RTL issues here -> #17012
ionitron-bot commentedon Feb 18, 2019
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.