From 70325be5cb4e81b25aaecbdbd139f29976056708 Mon Sep 17 00:00:00 2001 From: Quinton Jason Date: Mon, 16 Sep 2024 09:27:50 -0500 Subject: [PATCH] fix: update input group padding --- packages/sage-system/lib/inputgroup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sage-system/lib/inputgroup.js b/packages/sage-system/lib/inputgroup.js index e6c54dc407..2538b42dc0 100644 --- a/packages/sage-system/lib/inputgroup.js +++ b/packages/sage-system/lib/inputgroup.js @@ -28,9 +28,9 @@ Sage.inputgroup = (function() { inputGroupBtns.forEach(function(btn) { const parentGroup = btn.closest(".sage-input-group"); const field = parentGroup.querySelector(".sage-input__field"); - const parentDir = parentGroup.getAttribute('dir'); + const parentDir = btn.closest('html[dir="rtl"]'); - if (parentDir === 'rtl') { + if (parentDir) { field.style.paddingLeft = `${btn.offsetWidth + inputPaddingOffset}px`; } else { field.style.paddingRight = `${btn.offsetWidth + inputPaddingOffset}px`;