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

3117: Fix search term half-stays on language change #3134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lunars97
Copy link
Contributor

@lunars97 lunars97 commented Mar 4, 2025

Short Description

Currently search term stays in input after language change but the url query gets cleared out.

Proposed Changes

  • change defaultValue to value in TextInput because defaultValue contains the default value, while value contains the current value after some changes have been made.
  • use UseEffect to update filterText

Side Effects

  • none

Testing

  • Go to the search page
  • Search for Augsburg
  • Change the language
  • See that url query and search input text disappear

Resolved Issues

Fixes: #3117


Copy link
Contributor

@LeandraH LeandraH left a comment

Choose a reason for hiding this comment

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

Very nice, thank you! Tested in Firefox

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Nicely done!

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Just requesting changes to avoid merging to discuss this. I am not 100% sure but shouldn't the solution be to change the url and keep the search term instead of clearing the search? I'd expect that the reason why users would change the language while searching something would be to get (different) results in another language instead of starting with a clean search? I am not entirely sure though, but I think I would expect that the query is the same after a language change. What do you think (also @f1sh1918 and @LeandraH)?

Edit: Might conflict with #3137.

@LeandraH
Copy link
Contributor

LeandraH commented Mar 6, 2025

No, I would expect the query to disappear when changing languages, I would expect to not be using the same words in a different language, especially since German is already handled.

Playing around with changing language during a search, I have found both possibilities on other sites.

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.

Search term half-stays on language change
4 participants