From 0ed7712ab105543cf3630dce9dc4d6a3b864e2b4 Mon Sep 17 00:00:00 2001 From: melloware Date: Thu, 29 Feb 2024 07:16:09 -0500 Subject: [PATCH] Fix #6055: DomHandler incorrect case for computed styles --- components/lib/utils/DomHandler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/utils/DomHandler.js b/components/lib/utils/DomHandler.js index b50473cb62..1bc680c250 100644 --- a/components/lib/utils/DomHandler.js +++ b/components/lib/utils/DomHandler.js @@ -599,7 +599,7 @@ export default class DomHandler { let styleDeclaration = node ? getComputedStyle(node) : null; return ( - styleDeclaration && (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'))) + styleDeclaration && (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflow-x')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflow-y'))) ); }; @@ -772,9 +772,9 @@ export default class DomHandler { } static scrollInView(container, item) { - let borderTopValue = getComputedStyle(container).getPropertyValue('borderTopWidth'); + let borderTopValue = getComputedStyle(container).getPropertyValue('border-top-width'); let borderTop = borderTopValue ? parseFloat(borderTopValue) : 0; - let paddingTopValue = getComputedStyle(container).getPropertyValue('paddingTop'); + let paddingTopValue = getComputedStyle(container).getPropertyValue('padding-top'); let paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0; let containerRect = container.getBoundingClientRect(); let itemRect = item.getBoundingClientRect();