Skip to content

Commit d74ddc0

Browse files
authored
docs: fix stale results in Icons search (#9802)
1 parent 3c238fe commit d74ddc0

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

packages/dev/s2-docs/src/MobileSearchMenu.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,13 @@ function MobileNav({initialTag}: {initialTag?: string}) {
315315
<MobileTabPanel key={library.id} id={library.id}>
316316
<Autocomplete
317317
key={isTypographySelected ? 'typography' : 'default'}
318+
inputValue={searchValue}
319+
onInputChange={handleSearchChange}
318320
filter={showIcons ? iconFilter : undefined}
319321
disableVirtualFocus={isTypographySelected}>
320322
<div className={stickySearchContainer}>
321323
<SearchField
322324
aria-label="Search"
323-
value={searchValue}
324-
onChange={handleSearchChange}
325325
onFocus={handleSearchFocus}
326326
onBlur={handleSearchBlur}
327327
placeholder={placeholderText}
@@ -403,4 +403,3 @@ function MobileNav({initialTag}: {initialTag?: string}) {
403403
</div>
404404
);
405405
}
406-

packages/dev/s2-docs/src/SearchMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ export function SearchMenu(props: SearchMenuProps) {
163163
<TabPanel key={tab.id} id={tab.id}>
164164
<Autocomplete
165165
key={selectedTagId === 'typography' ? 'typography' : 'default'}
166+
inputValue={searchValue}
167+
onInputChange={setSearchValue}
166168
filter={isIconsSelected ? iconFilter : undefined}
167169
disableVirtualFocus={selectedTagId === 'typography'}>
168170
<div className={style({display: 'flex', flexDirection: 'column', height: 'full'})}>
169171
<div className={style({flexShrink: 0, marginStart: 16, marginEnd: 64})}>
170172
<SearchField
171-
value={searchValue}
172-
onChange={setSearchValue}
173173
ref={searchRef}
174174
size="L"
175175
aria-label={`Search ${tab.label}`}

0 commit comments

Comments
 (0)