url 붙혀넣기 수정 .
parent
3cbc48181b
commit
9fe03a66cb
|
|
@ -124,6 +124,17 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 붙여넣기 시 URL만 추출
|
||||||
|
const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {
|
||||||
|
if (searchType !== 'url') return;
|
||||||
|
const pasted = e.clipboardData.getData('text');
|
||||||
|
const urlMatch = pasted.match(/https?:\/\/[^\s]+/);
|
||||||
|
if (urlMatch) {
|
||||||
|
e.preventDefault();
|
||||||
|
setInputValue(urlMatch[0]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 폼 제출 처리
|
// 폼 제출 처리
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
@ -212,6 +223,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
onPaste={handlePaste}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
if (searchType === 'name' && autocompleteResults.length > 0) {
|
||||||
setShowAutocomplete(true);
|
setShowAutocomplete(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue