diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx index 39a9b86b135..f140b3b5afc 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx @@ -98,6 +98,7 @@ type DataTableBaseProps = { | null | ((dataView?: DataSourceView) => React.ReactElement); powerSearchInitialState?: SearchExpressionTerm[]; + onSearchExpressionChange?: (searchExpression: SearchExpressionTerm[]) => void; /** * Adds a special power search entry to search through the entire row (mathching a substring in it after stringifying it as a JSON) * @default true @@ -255,6 +256,10 @@ export function DataTable( useAssertStableRef(dataSource, 'dataSource'); useAssertStableRef(onRowStyle, 'onRowStyle'); useAssertStableRef(props.onSelect, 'onRowSelect'); + useAssertStableRef( + props.onSearchExpressionChange, + 'onSearchExpressionChanges', + ); useAssertStableRef(props.columns, 'columns'); useAssertStableRef(onCopyRows, 'onCopyRows'); useAssertStableRef(onContextMenu, 'onContextMenu'); @@ -929,6 +934,7 @@ export function DataTable( searchExpression={searchExpression} onSearchExpressionChange={(newSearchExpression) => { tableManager.setSearchExpression(newSearchExpression); + props.onSearchExpressionChange?.(newSearchExpression); }} onConfirmUnknownOption={ props.enablePowerSearchWholeRowSearch