Fixed #4014 - The `getScrollableParents` method throws a exception in shadow dom

pull/4107/head
mertsincan 2023-07-04 01:01:00 +01:00
parent af29b218a5
commit f23e5adc07
1 changed files with 6 additions and 2 deletions

View File

@ -357,9 +357,13 @@ export default {
const overflowRegex = /(auto|scroll)/;
const overflowCheck = (node) => {
try {
let styleDeclaration = window['getComputedStyle'](node, null);
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
} catch (err) {
return false;
}
};
for (let parent of parents) {