Skip to content

Commit 0226315

Browse files
committed
feat: add searchKey as initialSearchText
1 parent cc14701 commit 0226315

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Shared/Components/Plugin/PluginListContainer.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ const PluginListContainer = ({
4141

4242
const [pluginList, setPluginList] = useState<PluginListItemType[]>(parentPluginList || [])
4343
const [totalCount, setTotalCount] = useState<number>(parentTotalCount || 0)
44-
// TODO: Maybe structuredClone is not required
4544
const [filters, setFilters] = useState<PluginListFiltersType>(
4645
parentFilters || structuredClone(DEFAULT_PLUGIN_LIST_FILTERS),
4746
)
48-
// Have to make a state to trigger clear filters, since filters are not on URL
49-
// TODO: Ask should it be number since in case of large state it can be a problem
50-
const [clearSearchTrigger, setClearSearchTrigger] = useState<boolean>(false)
5147

5248
const handlePluginListUpdate = (updatedPluginList: PluginListItemType[]) => {
5349
setPluginList(updatedPluginList)
@@ -158,7 +154,6 @@ const PluginListContainer = ({
158154
selectedTags: [],
159155
})
160156

161-
setClearSearchTrigger((prev) => !prev)
162157
handlePersistFiltersChange()
163158
}
164159

@@ -198,7 +193,7 @@ const PluginListContainer = ({
198193
{/* Filters section */}
199194
<div className="w-100 flexbox dc__gap-12 py-12 dc__position-sticky dc__top-0 bcn-0 dc__zi-1 flex-wrap">
200195
<SearchBar
201-
key={`search-bar-key-${Number(clearSearchTrigger)}`}
196+
initialSearchText={searchKey}
202197
containerClassName="flex-grow-1"
203198
handleEnter={handleSearch}
204199
inputProps={{

0 commit comments

Comments
 (0)