Resetting a search bar (text input) with a button

I’m trying to create a button on my page that will reset a search bar and dropdowns. I can get the dropdowns to clear no problem with the following code:

//Reset Button//

export function Reset_click(event) {
$w("#dropdownYear").value = undefined;
$w("#dropdownStreet").value = undefined;
$w("#dropdownStatus").value = undefined;
$w("#dropdownMedia").value = undefined;
$w("#input1").value = "";


But no matter what I try I can’t get the search bar (“$w(”#input1").value = “”;" in the above code) to forget its previous user input and completely reset.

What currently happens is a user can use the search bar, get results, and hit reset, clearing the text from the search bar and seemingly resetting the repeater. However, after this using the search bar again OR using the dropdowns will use the same filter created by the previous search. So let’s say I type ‘animals’ into the search bar. I will get three results in the repeater. I can then hit ‘reset’ and the repeater will appear to go back to showing everything. However, if I then use a dropdown to search for ‘documentaries’ it will only show the one documentary that is also tagged with ‘animals’ rather than all documentaries in the dataset.
Playing around with it, it seems like the search bar is somehow saving whatever the first user input is and applying that to all the following searches, regardless of whether it’s been reset and appears empty.
Through googling I know other people have had this issue, but I haven’t come across any solutions yet. I’ve tried several variations on “$w(”#input1").value = “”;", replacing the “” with undefined and null, neither of which changes the results in anyway.

One wrinkle that may be useful info here. I’m using a split function on my search bar, so the full search bar code looks like this:

export function input1_keyPress(event, $w) {
 if (debounceTimer) {
    debounceTimer = undefined;
  debounceTimer = setTimeout(() => {
      SearchBar = $w('#input1').value;
searchWords = SearchBar.split(" ");
    filter(searchWords, lastFilterYear, lastFilterStreet, lastFilterStatus, lastFilterMedia);  
  }, 500);

Could this be part of why its not working? I did experiment with trying to reset ‘searchWords’ instead of ‘input1’, but didn’t have any luck there either. I’ll keep playing with it, but hopefully someone out there will already know what to do!

Haven’t had any luck getting this to work as I’d like, but created a workaround in the meantime. Using this code you can make the reset button reload the whole page. Takes longer than resetting the dataset, but accomplishes the same thing:

//Reset Button//
import wixLocation from 'wix-location';
export function Reset_click(event) {"https://yoursiteURL);

Note that this won’t seem to work in preview, but will work on the live site. Will keep looking for a way to completely reset the text input and welcome any solution people may have