Skip to content

Commit

Permalink
fix(datetime): navigating months in RTL works correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi committed Apr 29, 2024
1 parent 4f035ff commit b4b6d28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,8 @@ export class Datetime implements ComponentInterface {
* Check below the next line ensures that we did not
* swipe and abort (i.e. we swiped but we are still on the current month).
*/
const month = calendarBodyRef.scrollLeft <= 2 ? startMonth : endMonth;
const condition = isRTL(this.el) ? calendarBodyRef.scrollLeft >= -2 : calendarBodyRef.scrollLeft <= 2;
const month = condition ? startMonth : endMonth;

/**
* The edge of the month must be lined up with
Expand Down

0 comments on commit b4b6d28

Please sign in to comment.