Skip to content

Commit

Permalink
Fix: google translate extenstion close side panel (#4625)
Browse files Browse the repository at this point in the history
* Fix gtx-trans close sidepanel

* reset the package-lock.json file
  • Loading branch information
AbdelrhmanX7 authored Oct 24, 2023
1 parent 4f3b891 commit 309cf3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/hooks/use-outside-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 309cf3d

Please sign in to comment.