Wp-calypso: Reader Search allows a search for a single space

Created on 19 Jan 2017  路  6Comments  路  Source: Automattic/wp-calypso

I think we should ignore leading spaces. This matters because people often use the space bar to scroll. Since the search page gives focus to the search field on load, it's easy to search for a space when you meant to scroll the recs.

Steps to reproduce

  1. Starting at URL: https://wordpress.com/read/search
  2. Hit the spacebar

What I expected

Search field would ignore a leading space.

What happened instead

Search results come in for a single space: https://wordpress.com/read/search?q=%20

@gibrown - is this right? Or is this a bug?

Reader [Type] Bug

All 6 comments

Hmmm, ya, even worse is that it runs a query that matches all content and tries to sort it so the query times out most of the time... Ya it's a bug. we should handle it better...

Deployed fix to return a 400 error from the API when there is no text in the query being sent.

@samouri the handling when there is an error is not great though, so I think most of this needs to be fixed on the front end. Currently can't really tell the difference between "search is still running" and "no results because there was an error". Seems like in this case though we shouldn't even send the request since there is no visible text in the search.

@gibrown I'll look into fixing it this week

Pinging @samouri to remember this since search is now on the homepage, too.

thanks for the ping @fraying! I totally forgot about this. should be solved shortly!

This is fixed now. 馃帀

Was this page helpful?
0 / 5 - 0 ratings