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(PositionsGrid): remove previous searched item on next search #29

Closed
wants to merge 0 commits into from

Conversation

itsyuxuan
Copy link
Contributor

fix issue of #28 (comment)

@@ -48,6 +48,9 @@ export const PositionsGrid: React.FC<PositionsGridProps> = ({ positions, }) => {
ref={searchRef}
onKeyDown={(e) => {
if (e.key === 'Enter') {
if (document.querySelector('#inputText')?.innerHTML !== undefined) {
Copy link
Owner

Choose a reason for hiding this comment

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

Two problems:

  1. Please do not use DOM API in React component, you should use ref instead.
  2. Clear the search words on each enter press will make it not possible to add multiple search keywords.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感谢 review!为保持多关键词的搜索功能我打算撤销 pull request。

个人看法是:

  • 目前网站采用的多段关键词搜索(如图1)不太符合直觉
  • 多关键词的高级搜索通常是在同一行实现功能(如图2)
  • 就网站目前的规模和求职者快速检索特定公司的需求而言,每次搜索时先清除上一次的记录可能更实用
figure1.jpg
Figure1: 多段关键词搜索
figure2.jpg
Figure2: 关键词搜索

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants