diff --git a/src/pages/Dashboard/UrlInputContent.tsx b/src/pages/Dashboard/UrlInputContent.tsx index 2329fdc..12dec9c 100644 --- a/src/pages/Dashboard/UrlInputContent.tsx +++ b/src/pages/Dashboard/UrlInputContent.tsx @@ -124,6 +124,17 @@ const UrlInputContent: React.FC = ({ onAnalyze, onAutocomp } }; + // 붙여넣기 시 URL만 추출 + const handlePaste = (e: React.ClipboardEvent) => { + 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 = ({ onAnalyze, onAutocomp }, 300); } }} + onPaste={handlePaste} onFocus={() => { if (searchType === 'name' && autocompleteResults.length > 0) { setShowAutocomplete(true);