-
Notifications
You must be signed in to change notification settings - Fork 17
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
도시 검색 기능 특수문자 작성시 버그 수정 + 검색어와 매칭되는 제안도시가 하나일 시 엔터로 적용가능 #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
특수문자
특수문자 같은 경우에는 서+울
나 서울)))
해도 서울이 나오면 좋을 것 같아요! airbnb처럼요. 영어 같은 경우에는 사실 영어로 검색해도 나오면 좋은데... 이건 힘들겠죠...?
@@ -30,7 +30,7 @@ const CitySearchBar = ({ initialCities, updateCityInfo, required = false }: City | |||
const { cityTags, addCityTag, deleteCityTag } = useCityTags(initialCities ?? []); | |||
const { isOpen: isSuggestionOpen, open: openSuggestion, close: closeSuggestion } = useOverlay(); | |||
const inputRef = useRef<HTMLInputElement>(null); | |||
const debouncedQueryWord = useDebounce(queryWord, 300); | |||
const debouncedQueryWord = useDebounce(queryWord, 150); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 300에서 150으로 바꾼 이유가 있나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
쪼금 더 자연스러운 느낌이 들더라구요?! 개인마다 다르겠지만 검색결과 없다는 텍스트도 잘 안보이는 편이라 150~~
|
||
if (e.key === 'Escape') { | ||
//이거 onClose 프롭스로 받기 싫어서 꼼수로 일단 구현함.... | ||
onItemSelect(suggestions[-1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요정도 deps면 그냥 props 받아도 되지 않을까요.....?? props로 넘겨주는게 더 명확할 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋ그럴게요! 뭔가 저 함수 프롭스로 넘겨주는 거 안좋아해여 이유는 없음 ㅋㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥🔥🔥
frontend/src/utils/formatter.ts
Outdated
@@ -19,3 +19,15 @@ export const dateRangeToString = (dateRange: DateRangeData) => { | |||
|
|||
return `${formatDate(start)} - ${formatDate(end)}`; | |||
}; | |||
|
|||
export const stringToOnlyLetter = (string: string) => { | |||
const koreanCharacterRegex = /^[A-Za-z가-힣ㄱ-ㅎ]+$/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아예 상수로 빼도 될지도?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥🔥🔥
📄 Summary
특수문자
이거 입력을 아예 못하게 할까 고민했는데 그건 사용자입장에서 좀 아닌 거 같아서
문자만(한글+영어) 정규표현식으로 걸러내게 했어용.
근데 그러면
서+울
도서울
과 매칭되는 재밌는 결과가 나오는데.. 이에 대해 의견있으시다면 알려주세요!ESC
제안이 뜬 상태에서
esc
누르면 제안창이 닫히는 게 좋을 것 같아서 추가했는데 약간 꼼수로직으로 했습니다..헤헤 맘에 안들면 수정가능~~
🙋🏻 More
close #121