Skip to content

bug: opened page does not properly react on changes of dir attribute #26794

Description

@stanislavkulibaba

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • v7.x
  • Nightly

Current Behavior

When setting dir="rtl" or dir="ltr", an active page(pages which are already opened as well) does not change swipe gesture direction but animation direction does.

Expected Behavior

Swipe gesture should change it's direction from rtl to ltr and vice versa

Steps to Reproduce

  1. Open page
  2. Change language direction in the app (dir attribute)
  3. Check opened page

Code Reproduction URL

No response

Ionic Info

"@ionic/angular": "6.5.0",
"@ionic/core": "6.5.0",

Additional Information

Happens because the rtl property calculated only once during page init and never recalculated.

export const createSwipeBackGesture = (
  el: HTMLElement,
  canStartHandler: () => boolean,
  onStartHandler: () => void,
  onMoveHandler: (step: number) => void,
  onEndHandler: (shouldComplete: boolean, step: number, dur: number) => void
): Gesture => {
  const win = el.ownerDocument!.defaultView!;
  const rtl = isRTL(el); <----

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions