Skip to content

Commit

Permalink
fix: search input focus issue (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
shelegdmitriy authored Jun 4, 2024
1 parent d089c7f commit d8ef0aa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Navigation/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ const handleInteractOutside = (e) => {
};

return (
<Popover.Root open={showTypeAheadDropdown}>
<Popover.Trigger asChild>
<HoverCard.Root openDelay={200} closeDelay={300} open={showTypeAheadDropdown}>
<HoverCard.Trigger asChild>
<div>
<Widget
src="${REPL_ACCOUNT}/widget/DIG.InputSearch"
props={{
onQueryChange: handleOnInput,
placeholder: "Search NEAR",
onBlur: () => setIsFocused(false),
onFocus: () => setIsFocused(true),
}}
/>
</div>
</Popover.Trigger>
<Popover.Content asChild onInteractOutside={handleInteractOutside} onOpenAutoFocus={() => {}}>
</HoverCard.Trigger>
<HoverCard.Content asChild side="bottom" sideOffset={10} hideWhenDetached={true}>
<div>
<Widget
src="${REPL_ACCOUNT}/widget/Search.TypeAheadDropdown"
Expand All @@ -35,6 +37,6 @@ return (
}}
/>
</div>
</Popover.Content>
</Popover.Root>
</HoverCard.Content>
</HoverCard.Root>
);

0 comments on commit d8ef0aa

Please sign in to comment.