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

Cannot fully clear search field #551

Closed
ethanbishop opened this issue Jun 3, 2020 · 5 comments
Closed

Cannot fully clear search field #551

ethanbishop opened this issue Jun 3, 2020 · 5 comments
Labels

Comments

@ethanbishop
Copy link

Describe the bug
The search field cannot be reset to what was last searched for (or cannot be cleared if not used yet).

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Search'
  2. Type (e.g.) 'Identity theft', but don't press enter
  3. Use backspace to clear the search
  4. Notice you can't clear the last character 'I' (although you can select and replace it with something else)

Also:

  1. Go to 'Search'
  2. Type (e.g.) 'Identity theft' and press enter to search
  3. Clear the search field
  4. Type 'Identity theft' again
  5. Notice the final 't' cannot be entered

No error appears in the console, the keypress seem to just be silently rejected. Also happens on mobile.

Expected behavior
You can clear the search field entirely, and re-enter the thing you just searched for.

Screenshots

Environment details:

  • OS: Windows, Linux, Android
  • Browser: Chrome (desktop and mobile), Firefox
  • Iris version: 3.49.0

Additional context
In case it's relevant, mopidy (3.0.2) and iris are running on a Ubuntu 19.10 server, using mopidy-spotify (spotify is authorised)

@ethanbishop ethanbishop added the bug label Jun 3, 2020
@ethanbishop
Copy link
Author

If I can provide any more details to help diagnose the issue I'm happy to help. If I get a moment I might see if I can figure it out and put a pull request together.

As an aside, we recently upgraded from 2.something to the latest, and I'm loving the new features, really nice, makes our media server a dream, great job :)

@portothree
Copy link

I was just going to make a issue about this.
I think it has something to do with the onChange method of SearchForm.js component that does not fire the last event of change but I'm not a react developer so I will try to investigate further.

@jaedb
Copy link
Owner

jaedb commented Jun 4, 2020

I'll be honest, this is one part that I'm not entirely happy with. The perfect result would be:

  1. Enter term in search field
  2. Hit enter
  3. URL changes to search/${type}/${term}
  4. Props update triggers check for previous search results (as would be the case if you've hit back on the browser)
  5. Search services triggered and results appear as appropriate
    I'm confident that this approach would fix the above issue because the URL wouldn't contain any search terms, thus no results or terms would be inherited. However it is a pretty large block of work so will take a bit of time.

@jaedb
Copy link
Owner

jaedb commented Jun 23, 2020

Released as at 3.50.0

@jaedb jaedb closed this as completed Jun 23, 2020
@ethanbishop
Copy link
Author

Thanks all, works a treat!

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

No branches or pull requests

3 participants