2
0

🐛 Freeze body overflow when opening a Popup embed (#937)

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 -->
This commit is contained in:
Rishi Raj Jain
2023-10-17 18:46:14 +05:30
committed by GitHub
parent 3e06d89873
commit df3a17efa0

View File

@ -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)
}