From 687e132409e912f1017266dd6eb978c4421d294d Mon Sep 17 00:00:00 2001 From: Layal Khatib Date: Tue, 5 Dec 2023 13:43:05 +0200 Subject: [PATCH] Fix Direction.resolve for rtl --- src/components/direction.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/direction.js b/src/components/direction.js index 24be933d..2b475035 100644 --- a/src/components/direction.js +++ b/src/components/direction.js @@ -4,8 +4,7 @@ import { define } from '../utils/object' const VALID_DIRECTIONS = ['ltr', 'rtl'] const FLIPED_MOVEMENTS = { '>': '<', - '<': '>', - '=': '=' + '<': '>' } export default function (Glide, Components, Events) { @@ -26,10 +25,10 @@ export default function (Glide, Components, Events) { * @returns {String} */ resolve (pattern) { - const token = pattern.slice(0, 1) - if (this.is('rtl')) { - return pattern.split(token).join(FLIPED_MOVEMENTS[token]) + return pattern.split('').map(function (c) { + return FLIPED_MOVEMENTS[c] || c + }).join('') } return pattern