Skip to content

Commit

Permalink
[fix] 보컬 페이지의 필터 메뉴 외부 클릭 기능 임시 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
jjongs2 committed Sep 5, 2023
1 parent 06f1b85 commit 8ab2392
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions components/status/BocalStatusBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function BocalStatusBoard({
const currentPage = Number(page);
const initialOffset = getPageOffset(currentPage);

const filterRef = useRef<HTMLDivElement>(null);
// const filterRef = useRef<HTMLDivElement>(null);
const [checked, setChecked] = useState(false);
const [formInfos, setFormInfos] = useState<ApplicationFormInfo[]>();
const [pageCount, setPageCount] = useState<number>();
Expand Down Expand Up @@ -93,18 +93,18 @@ export default function BocalStatusBoard({
void router.push({ query });
}, [selectedFormInfo]);

useEffect(() => {
function handleOutsideClick(event: any): void {
if (!showDropDown) return;
if (!filterRef.current.contains(event.target as Node)) {
setShowDropDown(false);
}
}
document.addEventListener('mousedown', handleOutsideClick);
return () => {
document.removeEventListener('mousedown', handleOutsideClick);
};
}, [showDropDown]);
// useEffect(() => {
// function handleOutsideClick(event: any): void {
// if (!showDropDown) return;
// if (!filterRef.current.contains(event.target as Node)) {
// setShowDropDown(false);
// }
// }
// document.addEventListener('mousedown', handleOutsideClick);
// return () => {
// document.removeEventListener('mousedown', handleOutsideClick);
// };
// }, [showDropDown]);

if (formInfos === undefined) return;
if (pageNumbers === undefined) return;
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function BocalStatusBoard({
<div className='flex space-x-2'>{btnBox}</div>
</div>
<div className='relative inline-block text-left'>
<div ref={filterRef}>
<div>
<button
type='button'
className='inline-flex w-full justify-center gap-x-1.5 whitespace-nowrap rounded-md bg-white px-3 py-2 text-xs font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50'
Expand Down

0 comments on commit 8ab2392

Please sign in to comment.