From c775615868393566d6cf6caa0820869890da97a2 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Wed, 30 Jul 2025 09:04:52 -0400 Subject: [PATCH] [MM-64893] Account for extra whitespace when replacing date on search hint (#33563) * [MM-64893] Account for extra whitespace when replacing date on search hint * Fix ordering of caret position and selection range * Revert "Fix ordering of caret position and selection range" This reverts commit 9d6fc51ef35c242817a52b6206610abc5fc55503. * Remove delayInputUpdate --- webapp/channels/src/components/new_search/search_box.tsx | 2 +- webapp/channels/src/components/new_search/search_box_input.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/webapp/channels/src/components/new_search/search_box.tsx b/webapp/channels/src/components/new_search/search_box.tsx index 78dde9b09a4..6936a1248bb 100644 --- a/webapp/channels/src/components/new_search/search_box.tsx +++ b/webapp/channels/src/components/new_search/search_box.tsx @@ -175,7 +175,7 @@ const SearchBox = forwardRef( } setSearchTerms( - searchTerms.slice(0, caretPosition).replace(new RegExp(escapedMatchedPretext + '$', 'i'), '').trimEnd() + + searchTerms.slice(0, caretPosition).trimEnd().replace(new RegExp(escapedMatchedPretext + '$', 'i'), '').trimEnd() + val + extraSpace + searchTerms.slice(caretPosition), diff --git a/webapp/channels/src/components/new_search/search_box_input.tsx b/webapp/channels/src/components/new_search/search_box_input.tsx index d6d12c416f9..19a5b1e41f4 100644 --- a/webapp/channels/src/components/new_search/search_box_input.tsx +++ b/webapp/channels/src/components/new_search/search_box_input.tsx @@ -111,7 +111,6 @@ const SearchInput = forwardRef(({searchTerms, searchTyp value={searchTerms} onChange={inputChangeCallback} type='search' - delayInputUpdate={true} clearable={true} autoFocus={true} onKeyDown={onKeyDown}