feat: add initial focus on new integration search (#2015)
This commit is contained in:
@@ -15,7 +15,9 @@ export const IntegrationCreateDropdownContent = () => {
|
|||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
const filteredKinds = useMemo(() => {
|
const filteredKinds = useMemo(() => {
|
||||||
return integrationKinds.filter((kind) => kind.includes(search.toLowerCase()));
|
return integrationKinds.filter((kind) =>
|
||||||
|
getIntegrationName(kind).toLowerCase().includes(search.toLowerCase().trim()),
|
||||||
|
);
|
||||||
}, [search]);
|
}, [search]);
|
||||||
|
|
||||||
const handleSearch = React.useCallback(
|
const handleSearch = React.useCallback(
|
||||||
@@ -29,6 +31,7 @@ export const IntegrationCreateDropdownContent = () => {
|
|||||||
leftSection={<IconSearch stroke={1.5} size={20} />}
|
leftSection={<IconSearch stroke={1.5} size={20} />}
|
||||||
placeholder={t("integration.page.list.search")}
|
placeholder={t("integration.page.list.search")}
|
||||||
value={search}
|
value={search}
|
||||||
|
data-autofocus
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,15 @@ export default async function IntegrationsPage(props: IntegrationsPageProps) {
|
|||||||
|
|
||||||
const IntegrationSelectMenu = ({ children }: PropsWithChildren) => {
|
const IntegrationSelectMenu = ({ children }: PropsWithChildren) => {
|
||||||
return (
|
return (
|
||||||
<Menu width={256} trapFocus position="bottom-end" withinPortal shadow="md" keepMounted={false}>
|
<Menu
|
||||||
|
width={256}
|
||||||
|
trapFocus
|
||||||
|
position="bottom-end"
|
||||||
|
withinPortal
|
||||||
|
shadow="md"
|
||||||
|
keepMounted={false}
|
||||||
|
withInitialFocusPlaceholder={false}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
<MenuDropdown>
|
<MenuDropdown>
|
||||||
<IntegrationCreateDropdownContent />
|
<IntegrationCreateDropdownContent />
|
||||||
|
|||||||
Reference in New Issue
Block a user