mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-12 20:24:21 +02:00
Fix: google translate extenstion close side panel (#4625)
* Fix gtx-trans close sidepanel * reset the package-lock.json file
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user