Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/#162 NaYeonQA #164

Merged
merged 14 commits into from
Sep 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/@components/MyPage/NicknameModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ export default function NicknameModal(props: ModifyNicknameProps) {
}
};

const checkSpaceBar = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === " ") {
e.preventDefault();
return false;
}
};

Comment on lines +38 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 입력할 때 말고 valid 확인할 때 확인하지는 못하는 건가요??!

return (
<Modal closeHandler={closeHandler}>
<St.Container>
Expand All @@ -41,7 +48,13 @@ export default function NicknameModal(props: ModifyNicknameProps) {
</St.Wrapper>
<St.Wrapper>
<St.Label>새로운 닉네임</St.Label>
<St.NewNickname aria-label="새로운 닉네임 입력칸" type="text" id="newNickname" onChange={onChangeNickname} />
<St.NewNickname
aria-label="새로운 닉네임 입력칸"
type="text"
id="newNickname"
onChange={onChangeNickname}
onKeyDown={(e) => checkSpaceBar(e)}
/>
{errorMessage !== "" && <St.ErrorMessage>{errorMessage}</St.ErrorMessage>}
</St.Wrapper>
<St.ButtonWrapper>
Expand Down