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) => {
|
||||
e.preventDefault();
|
||||
|
|
@ -212,6 +223,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
|||
}, 300);
|
||||
}
|
||||
}}
|
||||
onPaste={handlePaste}
|
||||
onFocus={() => {
|
||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
||||
setShowAutocomplete(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue