Merge pull request #964 from PeterKwesiAnsah/fix-mobile-scrollbar

Fix mobile scrollbar
This commit is contained in:
Manoj Vivek 2023-06-14 21:19:02 +05:30 committed by GitHub
commit e65581c77e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,6 +390,25 @@ const Device = ({ isPrimary, device, setIndividualDevice }: Props) => {
})();
}, [isInspecting]);
useEffect(() => {
if (!ref.current || !device.isMobileCapable) {
return;
}
const webview = ref.current;
webview.addEventListener('dom-ready', () => {
webview.insertCSS(`
::-webkit-scrollbar {
display: none;
} `);
});
// eslint-disable-next-line consistent-return
return () => {
webview.removeEventListener('dom-ready', () => {});
};
}, [device.isMobileCapable]);
const scaledHeight = height * zoomfactor;
const scaledWidth = width * zoomfactor;