Skip to content

Commit

Permalink
🐛 fix(tab): correction de l'ombre au scroll en RTL (#1051)
Browse files Browse the repository at this point in the history
- Correction de l'ombre au scroll en direction RTL
  • Loading branch information
keryanS authored Nov 25, 2024
1 parent f67153c commit ffbed46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dsfr/component/tab/script/tab/tabs-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ class TabsList extends api.core.Instance {

/* ajoute la classe fr-table__shadow-left ou fr-table__shadow-right sur fr-table en fonction d'une valeur de scroll et du sens (right, left) */
scroll () {
const scrollLeft = this.node.scrollLeft;
const scrollLeft = Math.abs(this.node.scrollLeft);
const isMin = scrollLeft <= SCROLL_OFFSET;
const max = this.node.scrollWidth - this.node.clientWidth - SCROLL_OFFSET;

const isMax = Math.abs(scrollLeft) >= max;
const isRtl = document.documentElement.getAttribute('dir') === 'rtl';
const isRtl = getComputedStyle(this.node).direction === 'rtl';
const minSelector = isRtl ? TabSelector.SHADOW_RIGHT : TabSelector.SHADOW_LEFT;
const maxSelector = isRtl ? TabSelector.SHADOW_LEFT : TabSelector.SHADOW_RIGHT;

Expand Down

0 comments on commit ffbed46

Please sign in to comment.