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

도시 검색 기능 특수문자 작성시 버그 수정 + 검색어와 매칭되는 제안도시가 하나일 시 엔터로 적용가능 #159

Merged
merged 9 commits into from
Jul 28, 2023

Conversation

Dahyeeee
Copy link
Collaborator

@Dahyeeee Dahyeeee commented Jul 27, 2023

📄 Summary

특수문자

이거 입력을 아예 못하게 할까 고민했는데 그건 사용자입장에서 좀 아닌 거 같아서
문자만(한글+영어) 정규표현식으로 걸러내게 했어용.
근데 그러면 서+울서울과 매칭되는 재밌는 결과가 나오는데.. 이에 대해 의견있으시다면 알려주세요!

ESC

제안이 뜬 상태에서 esc누르면 제안창이 닫히는 게 좋을 것 같아서 추가했는데 약간 꼼수로직으로 했습니다..
헤헤 맘에 안들면 수정가능~~

🙋🏻 More

close #121

@Dahyeeee Dahyeeee added 🐞 Bug 🔨 Refactor FE-Service 행록 서비스 프론트엔드 labels Jul 27, 2023
@Dahyeeee Dahyeeee self-assigned this Jul 27, 2023
Copy link
Collaborator

@ashleysyheo ashleysyheo left a 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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

오 300에서 150으로 바꾼 이유가 있나요??

Copy link
Collaborator Author

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]);
Copy link
Collaborator

@ashleysyheo ashleysyheo Jul 27, 2023

Choose a reason for hiding this comment

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

요정도 deps면 그냥 props 받아도 되지 않을까요.....?? props로 넘겨주는게 더 명확할 것 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋ그럴게요! 뭔가 저 함수 프롭스로 넘겨주는 거 안좋아해여 이유는 없음 ㅋㅋㅋ

Copy link
Collaborator

@ashleysyheo ashleysyheo left a comment

Choose a reason for hiding this comment

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

🔥🔥🔥

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

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

아예 상수로 빼도 될지도?!

Copy link
Member

@dladncks1217 dladncks1217 left a comment

Choose a reason for hiding this comment

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

🔥🔥🔥

@Dahyeeee Dahyeeee merged commit a62694c into develop Jul 28, 2023
1 check passed
@Dahyeeee Dahyeeee deleted the feature/#121 branch July 29, 2023 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug FE-Service 행록 서비스 프론트엔드 🔨 Refactor
Projects
None yet
3 participants