Skip to content

Commit

Permalink
🐛 Freeze body overflow when opening a Popup embed (#937)
Browse files Browse the repository at this point in the history
fix #763
/claim #763

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
### Summary by CodeRabbit

- **Enhancement**: Improved the visibility management of the bot in the
popup. This update ensures a smoother and more intuitive user experience
when interacting with the bot.
- **Bug Fix**: Resolved an issue where certain styles could interfere
with the bot's visibility in the popup. The update prioritizes the
necessary style settings, ensuring the bot's visibility is maintained as
expected, regardless of other conflicting styles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
Rishi Raj Jain authored Oct 17, 2023
1 parent 3e06d89 commit df3a17e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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.setProperty('overflow', 'hidden', 'important')
document.addEventListener('pointerdown', closeBot)
}

Expand Down

1 comment on commit df3a17e

@vercel
Copy link

@vercel vercel bot commented on df3a17e Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.