edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

[Test failure] <TC-00065>: Course search pill not cleared when text deleted

Open saraburns1 opened this issue 2 months ago • 4 comments

Release

Ulmo

Expected behavior

I am able to clear my search by clicking X on the pill with my search term on it that appears under the search bar OR by deleting the search term in the search bar and clicking search or hitting enter

When i delete the search term in the search bar and click search, the search term under the bar (with the X) should disappear

Actual behavior

Pill with search term under the bar remains even when search bar text is cleared & all courses are returned

search results:

Image

after deleting search bar text:

Image

Steps to reproduce

  1. Go to https://ulmo.demo.edly.io/courses
  2. Type 'test' in search bar and hit enter
  3. Delete 'test' from search bar and hit enter
  4. See 'test' box still under search bar even though all 14 results are being shown

Additional information

No response

saraburns1 avatar Nov 19 '25 16:11 saraburns1

Hello @saraburns1, thanks!

I was testing in the sandbox, and the reported issue is indeed happening. I also tested in a Redwood and Teak environment, and the same thing occurs.

Although the filter in the search does get cleared and works correctly, the pill with the old term still appears, which is confusing. A simple solution is to remove that filter when the search is performed if the input is empty.

I tested something like this locally, and it works well:

dispatcher.listenTo(form, 'search', function(query) {
    form.showLoadingIndicator();
    if (!query || query.trim() === '') {
        filters.remove('search_query');
    }
    search.performSearch(query, filters.getTerms());
});

https://github.com/user-attachments/assets/d935cb94-1daa-4dc3-9683-4a87a51ac127

BryanttV avatar Nov 20 '25 22:11 BryanttV

The suggested solution is ready to review in this PR: https://github.com/openedx/edx-platform/pull/37709

Asespinel avatar Dec 01 '25 16:12 Asespinel

The original PR was merged into master and I opened a backport for ulmo here: https://github.com/openedx/edx-platform/pull/37734

cc: @magajh

Asespinel avatar Dec 09 '25 16:12 Asespinel

The backport for ulmo was merged

magajh avatar Dec 10 '25 11:12 magajh