Skip to content

Commit

Permalink
feat: (#468) 이미지 업로드 시 파일창이 두번 나오는 오류 수정
Browse files Browse the repository at this point in the history
- 기본 이벤트로 인한 호출 오류
  • Loading branch information
chsua committed Aug 17, 2023
1 parent 953506e commit 5a15ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, MutableRefObject } from 'react';
import { ChangeEvent, MouseEvent, MutableRefObject } from 'react';

import { Size } from '@type/style';

Expand All @@ -18,7 +18,8 @@ interface ContentImageSectionProps {
export default function ContentImageSection({ contentImageHook, size }: ContentImageSectionProps) {
const { contentImage, contentInputRef, removeImage, handleUploadImage } = contentImageHook;

const handleButtonClick = () => {
const handleButtonClick = (e: MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
contentInputRef.current && contentInputRef.current.click();
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef } from 'react';
import React, { MouseEvent, useRef } from 'react';

import photoIcon from '@assets/photo_white.svg';

Expand All @@ -17,7 +17,8 @@ export default function OptionUploadImageButton({
const inputRef = useRef<HTMLInputElement>(null);
const id = optionId.toString();

const handleButtonClick = () => {
const handleButtonClick = (e: MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
inputRef.current && inputRef.current.click();
};

Expand Down

0 comments on commit 5a15ca4

Please sign in to comment.