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

fixes bug in tag search feature #4222

Merged
merged 4 commits into from
Oct 8, 2019

Conversation

torianne02
Copy link
Contributor

@torianne02 torianne02 commented Oct 3, 2019

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

When typing in tags using the v2 editor, the tag disappears once you've typed in the full word. For example, if you want to type in javascript it will appear as a choice all the way up until you add the t at the end of the word which causes it to disappear from the choice list.

In order to fix this functionality I added an OR statement to the search method in the app/javascript/shared/components/tags.jsx file.

I also made a few fixes to this file according to the eslint recommendations. They were minor changes, such as using prevState callback and reordering methods. Another suggestion from eslint that I implemented was to change all != comparison to !==.

A possible future edit could be to make sure a tag doesn't appear once it's already been chosen when searching. I'd be glad to work on that logic as well if needed.

Related Tickets & Documents

Someone reported the bug as a triage issue. The link to this is here.

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

N/A

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

Michael Scott and Dwight Schrute raising the roof

My first open source pull request!!!!

now allows user to type in full name of tag and it does not disappear
makes other changes to pass eslint failing tests
moves methods around according to eslint tests
makes use of prevState callback method due to eslint tests
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 3, 2019
@CLAassistant
Copy link

CLAassistant commented Oct 3, 2019

CLA assistant check
All committers have signed the CLA.

removes complex logical expression comparison from !== to !=
changes made due to failing task in pull request
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

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

Great job @torianne02 and great catch!

I've added some notes and a question but I've also tested it locally and it looks okay.

I'll wait for your feedback and then approve it!

app/javascript/shared/components/tags.jsx Outdated Show resolved Hide resolved
app/javascript/shared/components/tags.jsx Outdated Show resolved Hide resolved
app/javascript/shared/components/tags.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

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

Great job @torianne02,

It works perfectly!

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 8, 2019
@benhalpern benhalpern merged commit e111951 into forem:master Oct 8, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Oct 8, 2019
RakChamp25 pushed a commit to RakChamp25/dev.to that referenced this pull request Oct 15, 2019
* fixes bug in tag search feature
now allows user to type in full name of tag and it does not disappear
makes other changes to pass eslint failing tests
moves methods around according to eslint tests
makes use of prevState callback method due to eslint tests

* updates handleKeyDown method
removes complex logical expression comparison from !== to !=
changes made due to failing task in pull request

* removes commented out code that I added to test code
updates logic to fix searchResults
removes .filter()

* adds comments to fixed code for clarification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants