-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed as not planned
Labels
PR welcomeGood for new contributorGood for new contributorStaleenhancementNew feature or requestNew feature or request
Description
Describe the bug
When searching for memos in CreateMemoRelationDialog the user can't input whitespaces.
Steps to reproduce
- Click on the
Add referencebutton in Memo editor - 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.
memos/web/src/components/CreateMemoRelationDialog.tsx
Lines 106 to 109 in 57510dd
| 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
Labels
PR welcomeGood for new contributorGood for new contributorStaleenhancementNew feature or requestNew feature or request