Fix: google translate extenstion close side panel (#4625)

* Fix gtx-trans close sidepanel

* reset the package-lock.json file
pull/4628/head
Abdelrhman Kamal 1 year ago committed by GitHub
parent 4f3b891e45
commit 309cf3d6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package-lock.json
  2. 4
      src/hooks/use-outside-click.ts

2
package-lock.json generated

@ -11025,4 +11025,4 @@
}
}
}
}
}

@ -3,7 +3,9 @@ import { useEffect } from 'react';
export function useOutsideClick(ref: any, callback: any) {
useEffect(() => {
const listener = (event: any) => {
const isClickedOutside = !ref?.current?.contains(event.target);
const isClickedOutside =
!ref?.current?.contains(event.target) &&
!document?.getElementById('gtx-trans')?.contains(event.target);
if (isClickedOutside) {
callback();
}

Loading…
Cancel
Save