Skip to content

Commit

Permalink
fix(popover): add check for element in getComputeStyle function
Browse files Browse the repository at this point in the history
  • Loading branch information
anuradha9712 authored and innosatyam committed Sep 9, 2024
1 parent 9b6c601 commit 03f016c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/components/atoms/popperWrapper/PopperWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,13 @@ export class PopperWrapper extends React.Component<PopperWrapperProps, PopperWra
const shouldPopoverClose = (clicked: HTMLElement): boolean => {
const popover = this.popupRef.current as HTMLElement;
const container = document.body;
const popoverIndex = parseInt(window.getComputedStyle(popover).zIndex);
const popoverIndex = popover && parseInt(window.getComputedStyle(popover).zIndex);
let clickInsideLayer = false;
let shouldClose = false;

const openedLayers = container.querySelectorAll('[data-opened="true"]');
openedLayers.forEach((layer) => {
if (layer.contains(clicked)) {
if (layer && layer.contains(clicked)) {
clickInsideLayer = true;
const clickedIndex = parseInt(window.getComputedStyle(layer).zIndex);
if (popoverIndex > clickedIndex) {
Expand Down

0 comments on commit 03f016c

Please sign in to comment.