Skip to content

Commit

Permalink
Fixed #2352 - Dropdown breaks in shadowRoot when getScrollableParent(…
Browse files Browse the repository at this point in the history
…) encounters document fragment
  • Loading branch information
mertsincan committed Nov 3, 2021
1 parent 04dc17d commit 2eb20fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/utils/DomHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@ export default class DomHandler {
let parents = this.getParents(element);
const overflowRegex = /(auto|scroll)/;
const overflowCheck = (node) => {
let styleDeclaration = window['getComputedStyle'](node, null);
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
let styleDeclaration = node ? getComputedStyle(node) : null;
return styleDeclaration && (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY')));
};

for (let parent of parents) {
Expand Down

0 comments on commit 2eb20fa

Please sign in to comment.