Skip to content

Commit

Permalink
Update Popup.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishi Raj Jain authored Oct 16, 2023
1 parent 1d0aab7 commit dcfd882
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/embeds/js/src/features/popup/components/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const Popup = (props: PopupProps) => {
const openBot = () => {
setIsBotOpened(true)
popupProps.onOpen?.()
document.body.style.overflow = 'hidden'
document.body.style.cssText += 'overflow: hidden !important';
document.addEventListener('pointerdown', closeBot)
}

Expand All @@ -102,7 +102,12 @@ export const Popup = (props: PopupProps) => {
}

const toggleBot = () => {
isBotOpened() ? closeBot() : openBot()
if (isBotOpened()) {
closeBot()
}
else {
openBot()
}
}

return (
Expand Down

0 comments on commit dcfd882

Please sign in to comment.