Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kch2234 authored Nov 12, 2024
2 parents e44e9e0 + a7ce70d commit 413f94d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/quiz/QuizQuestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ interface QuizQuestionsProps {
const QuizQuestions: React.FC<QuizQuestionsProps> = ({ questions, answers, onAnswerChange }) => {
useEffect(() => {
// 오른쪽 클릭 방지
const handleContextMenu = (e: MouseEvent) => e.preventDefault();
const handleContextMenu = (e: MouseEvent | TouchEvent) => e.preventDefault();
document.addEventListener('contextmenu', handleContextMenu);
document.addEventListener('touchstart', handleContextMenu);

// 텍스트 선택 방지
document.body.style.userSelect = 'none';
Expand All @@ -34,6 +35,7 @@ const QuizQuestions: React.FC<QuizQuestionsProps> = ({ questions, answers, onAns
// 컴포넌트 언마운트 시 이벤트 제거
return () => {
document.removeEventListener('contextmenu', handleContextMenu);
document.removeEventListener('touchstart', handleContextMenu);
document.removeEventListener('keydown', handleKeyDown);
document.body.style.userSelect = 'auto';
};
Expand Down

0 comments on commit 413f94d

Please sign in to comment.