Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix autofocus on events page

Francis Caob89fb0a96274
diff --git a/src/app/(main)/websites/[websiteId]/events/EventsDataTable.tsx b/src/app/(main)/websites/[websiteId]/events/EventsDataTable.tsx
index 49b31656d..32eb985c6 100644
--- a/src/app/(main)/websites/[websiteId]/events/EventsDataTable.tsx
+++ b/src/app/(main)/websites/[websiteId]/events/EventsDataTable.tsx
@@ -13,7 +13,7 @@ export default function EventsDataTable({
const queryResult = useWebsiteEvents(websiteId);
return (
- <DataTable queryResult={queryResult} allowSearch={true}>
+ <DataTable queryResult={queryResult} allowSearch={true} autoFocus={false}>
{({ data }) => <EventsTable data={data} />}
</DataTable>
);
diff --git a/src/components/common/DataTable.tsx b/src/components/common/DataTable.tsx
index 22373f608..d2094329b 100644
--- a/src/components/common/DataTable.tsx
+++ b/src/components/common/DataTable.tsx
@@ -15,6 +15,7 @@ export interface DataTableProps {
searchDelay?: number;
allowSearch?: boolean;
allowPaging?: boolean;
+ autoFocus?: boolean;
renderEmpty?: () => ReactNode;
children: ReactNode | ((data: any) => ReactNode);
}
@@ -24,6 +25,7 @@ export function DataTable({
searchDelay = 600,
allowSearch = true,
allowPaging = true,
+ autoFocus = true,
renderEmpty,
children,
}: DataTableProps) {
@@ -57,7 +59,7 @@ export function DataTable({
value={query}
onSearch={handleSearch}
delay={searchDelay || DEFAULT_SEARCH_DELAY}
- autoFocus={true}
+ autoFocus={autoFocus}
placeholder={formatMessage(labels.search)}
/>
)}