Skip to content

Commit aa9633c

Browse files
authored
Merge pull request #255 from boostcampwm-2024/feature-input-refactor-fe
[Feature-input-refactor-fe] ์ฐฝ ํด๋ฆญ์‹œ ๋ณต์‚ฌ ๊ฐ€๋Šฅํ•˜๋„๋ก ์ˆ˜์ •
2 parents d43bf4a + 10fc56c commit aa9633c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

โ€Žclient/src/components/Modal/ShareModal.tsxโ€Ž

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ interface ShareModalProps {
1010

1111
export default function ShareModal({ open, closeModal }: ShareModalProps) {
1212
const [copySuccess, setCopySuccess] = useState(false);
13-
1413
const currentUrl = window.location.href;
1514

1615
async function copyLink() {
@@ -23,15 +22,21 @@ export default function ShareModal({ open, closeModal }: ShareModalProps) {
2322
setTimeout(() => setCopySuccess(false), 2000);
2423
}
2524

25+
function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
26+
e.stopPropagation();
27+
}
28+
2629
return (
2730
<Modal open={open} closeModal={closeModal}>
2831
<div className="py-4">
2932
<p className="mb-3 text-lg font-bold text-black">ํ˜‘์—… ๋งํฌ</p>
3033
<Input
3134
type="text"
32-
value={currentUrl}
3335
readOnly
34-
className="pointer-events-none h-10 w-full truncate rounded-lg bg-grayscale-200 px-3 py-2 text-grayscale-500"
36+
value={currentUrl}
37+
onClick={(e) => e.currentTarget.select()}
38+
onKeyDown={handleKeyDown}
39+
className="h-10 w-full truncate rounded-lg bg-grayscale-200 px-3 py-2 text-grayscale-500 focus:border-transparent focus:outline-none"
3540
/>
3641
<Button
3742
onClick={copyLink}

0 commit comments

Comments
ย (0)