Fix autofocus on events page

This commit is contained in:
Francis Cao 2024-08-27 16:28:03 -07:00
parent 398a665791
commit b89fb0a962
2 changed files with 4 additions and 2 deletions

View File

@ -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>
);

View File

@ -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)}
/>
)}