Skip to content

Can't input whitespace in create memo relation dialog #2901

@vinicius507

Description

@vinicius507

Describe the bug

When searching for memos in CreateMemoRelationDialog the user can't input whitespaces.

Steps to reproduce

  1. Click on the Add reference button in Memo editor
  2. Input search string containing whitespace (e.g. React Server Components)

The version of Memos you're using

0.19.1

Screenshots or additional context

The issue happens because the Autocomplete component calls setSearchText with value.trim(). While useful, the same component uses searchText as inputValue, which removes any whitespace before the user can enter the next word.

inputValue={searchText}
value={selectedMemos}
multiple
onInputChange={(_, value) => setSearchText(value.trim())}

A simple fix should be moving the trim() call to the useDebouce hook, although it would make the hook be called when the input inserts trailing spaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions