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

Avoid showing related issues when the issue title is empty #1281

Merged
merged 2 commits into from
Apr 24, 2018

Conversation

marcobeltempo
Copy link
Contributor

Fixes #1267

This pull request fixes the issue where suggestions would be displayed with an empty title.

Now, the user must enter a minimum of 3 characters in order to generate suggestions. Also if the user clears the title field leaves less than 3 characters, the suggestion box is removed.

refined-github_capture

@fregante
Copy link
Member

fregante commented Apr 24, 2018

Grazie Marco! There's already a check in getSearchableWords:

https://github.com/sindresorhus/refined-github/blob/c7497caa5f602a8a0ec28564833611761ef00bd7/source/features/display-issue-suggestions.js#L20

And if the suggestions remain faded if the search query is no longer long enough. It's fine this way as the search results are still useful to what the user previously typed.

@fregante fregante closed this Apr 24, 2018
@fregante
Copy link
Member

I guess the issue is actually about completely a empty field, rather than just "less than 3"

@fregante fregante reopened this Apr 24, 2018
@fregante fregante changed the title Fixes #1267: Prevent suggested issue w/ empty titles Avoid showing related issues when the issue title is empty Apr 24, 2018
@fregante fregante merged commit 4cfd571 into refined-github:master Apr 24, 2018
@marcobeltempo
Copy link
Contributor Author

@bfred-it thanks for the review!
(title.trim().length === 0) is a much cleaner fix

@marcobeltempo marcobeltempo deleted the issue1267 branch April 24, 2018 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Searching related issues is happening even on empty title
2 participants