Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Search open #2373

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions workspaces/core/src/search/private/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const InnerInput = forwardRef(
'focus:ring-0 bg-transparent placeholder-bulma text-bulma',
className
)}
onClick={() => {
onChangeOpen(true);
}}
onChange={(e) => {
onChangeSearch(e.currentTarget.value);
}}
Expand Down
10 changes: 6 additions & 4 deletions workspaces/core/src/search/private/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import React, {
useState,
} from 'react';
import { Transition as HeadlessTransition } from '@headlessui/react';
import mergeClassnames from '../../../mergeClassnames/mergeClassnames';
import useClickOutside from '../../../private/hooks/useClickOutside';
import { SearchContext, SelectContext } from '../utils/context';
import { Input } from './Input';
import NoResults from './NoResults';
import ResultItem from './ResultItem';
import mergeClassnames from '../../../mergeClassnames/mergeClassnames';
import useClickOutside from '../../../private/hooks/useClickOutside';
import type SearchProps from '../types/SearchProps';
import { SearchContext, SelectContext } from '../utils/context';

const SearchRoot = ({
selected: selectedParent,
Expand Down Expand Up @@ -135,8 +135,10 @@ const SearchRoot = ({
}
});

const openSearch = useCallback(() => onChangeOpen(true), []);

return (
<div ref={ref} onKeyDown={onKeyDown}>
<div ref={ref} onKeyDown={onKeyDown} onClick={openSearch}>
<div
className={mergeClassnames(
'relative w-full h-full bg-gohan flex flex-col border border-beerus',
Expand Down
Loading