[ENG-1250] Fix windows mouse navigation (#1538)

Fix windows mouse navigation
This commit is contained in:
ameer2468 2023-10-12 19:29:18 +03:00 committed by GitHub
parent 5a30aa7f2f
commit de341d0f2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,6 +23,7 @@ export const NavigationButtons = () => {
});
useEffect(() => {
if (os === 'windows') return; //windows already navigates back and forth with mouse buttons
const onMouseDown = (e: MouseEvent) => {
e.stopPropagation();
if (e.buttons === 8) {
@ -35,7 +36,7 @@ export const NavigationButtons = () => {
};
window.addEventListener('mousedown', onMouseDown);
return () => window.removeEventListener('mousedown', onMouseDown);
}, [navigate, idx, isFocused]);
}, [navigate, idx, isFocused, os]);
return (
<div data-tauri-drag-region={os === 'macOS'} className="flex">