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: segment not respecting rtl when dir set on host element #23978

Closed
5 of 6 tasks
Mohamed-Karkotly opened this issue Sep 24, 2021 · 2 comments · Fixed by #24601
Closed
5 of 6 tasks

bug: segment not respecting rtl when dir set on host element #23978

Mohamed-Karkotly opened this issue Sep 24, 2021 · 2 comments · Fixed by #24601
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@Mohamed-Karkotly
Copy link

Prequisites

Ionic Framework Version

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

Current Behavior

When layout is RTL the swipeGesture goes far left to the end when swiped right, and goes far right to the end when swiped left.

Expected Behavior

Behave the correct way as in LTR.

Steps to Reproduce

Create an ion-segment with attribute dir="rtl", then add few ion-segment-buttons inside of it and try swiping.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI                     : 6.17.1 (node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.8.0
   @angular-devkit/build-angular : 12.2.6
   @angular-devkit/schematics    : 12.1.4
   @angular/cli                  : 12.2.6
   @ionic/angular-toolkit        : 4.0.0

Capacitor:

   Capacitor CLI      : 3.2.3
   @capacitor/android : not installed
   @capacitor/core    : 3.2.3
   @capacitor/ios     : not installed

Utility:

   cordova-res : 0.15.3
   native-run  : 1.4.1

System:

   NodeJS : v14.17.1 (c:\Program Files\nodejs\node.exe)
   npm    : 6.14.13
   OS     : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Sep 24, 2021
@liamdebeasi
Copy link
Contributor

liamdebeasi commented Sep 24, 2021

Thanks for the issue. I can reproduce this behavior. This line looks to be the culprit: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/segment/segment.tsx#L310.

We determine RTL by looking at the document direction, but we do not look at the dir set on the host element. In other words, running your entire app in RTL mode is fine, but specifically running ion-segment in RTL mode does not work.

@liamdebeasi liamdebeasi changed the title bug: ion-segment swipeGesture property not behaving correctly on RTL bug: segment not respecting rtl when dir set on host element Sep 24, 2021
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Sep 24, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Feb 18, 2022

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants