Hi Oskar,
Please find the code
snippet and sample to blur the PDF Viewer when you click outside of the PDF
Viewer.
Code snippet:
|
React.useEffect(() => {
document.addEventListener('click', function (args) {
var
pdfViewerDiv = document.getElementById('container');
if
(pdfViewerDiv.contains(args.target))
{
pdfViewerDiv.style.filter
= 'none';
} else {
pdfViewerDiv.style.filter
= 'blur(5px)';
}
});
},
[]);
|
Sample: https://stackblitz.com/edit/react-yag7bp?file=index.js
In the provided
sample, when you click outside the PDF Viewer, the PDF Viewer blurs, and when
you click inside the PDF Viewer, the PDF Viewer won't be blurred.
Kindly try this and
If there's any misunderstanding regarding your requirement, or if your needs
differ, please provide more details such as a video recording or screenshots.
This will help us accurately identify your requirements and provide a suitable solution.