Skip to content

Quote search modal doesn't show all quotes after changing and then emptying the search bar #8342

Description

@Leonabcd123

Did you clear cache before opening an issue?

  • I have cleared my cache

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Does the issue happen when logged in?

Yes

Does the issue happen when logged out?

Yes

Does the issue happen in incognito mode when logged in?

Yes

Does the issue happen in incognito mode when logged out?

Yes

Account name

No response

Account config

No response

Current Behavior

If you type something in the search bar of the quote search modal, and then delete it, the quotes displayed are still the ones from the previous search.

The following error can be observed in the console:

Uncaught TypeError: can't access property "matchAll", text is undefined
    performSearch QuoteSearchModal.tsx:260
    QuoteSearchModal QuoteSearchModal.tsx:226
    exec index.js:77
    setTimeout handler*wrapper index.js:126
    result dev.js:493
    untrack dev.js:474
    on dev.js:493
    runComputation dev.js:744
    updateComputation dev.js:726
    runTop dev.js:846
    runUserEffects dev.js:956
    completeUpdates dev.js:913
    runUpdates dev.js:862
    completeUpdates dev.js:913
    runUpdates dev.js:863
    writeSignal dev.js:701
    setter dev.js:229
    onChange QuoteSearchModal.tsx:480
    triggerOnChangeListener FieldApi.ts:1839
    setValue FieldApi.ts:1056
    handleChange FieldApi.ts:1695
    $$input InputField.tsx:92
    handleNode dev.js:501
    eventHandler dev.js:522

Expected Behavior

It should show all quotes, just like it does when the input is empty when opening the modal.

Steps To Reproduce

  1. Open the commandline, type Search for quotes and press enter
  2. In the search bar, type a
  3. Delete it
  4. Notice how the shown quotes are still filtered by a, instead of showing all quotes.

Environment

  • OS: Arch Linux
  • Browser: Firefox
  • Browser Version: 153.0.3

Anything else?

The error is caused by convertStringToValue converting an empty string into undefined:

if (newValue === "") return undefined;

which is eventually passed to performSearch, which expects a string rather than string | undefined:

const performSearch = (text: string): void => {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions