Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/young-yaks-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Added optional `onAddFilterClick` callback prop to the indexFilters component
4 changes: 4 additions & 0 deletions polaris-react/src/components/IndexFilters/IndexFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export interface IndexFiltersProps
onSortKeyChange?: (value: string) => void;
/** Optional callback when using saved views and changing the sort direction */
onSortDirectionChange?: (value: string) => void;
/** Callback when the add filter button is clicked, to be passed to AlphaFilters. */
onAddFilterClick?: () => void;
/** The primary action to display */
primaryAction?: IndexFiltersPrimaryAction;
/** The cancel action to display */
Expand Down Expand Up @@ -99,6 +101,7 @@ export function IndexFilters({
onSort,
onSortKeyChange,
onSortDirectionChange,
onAddFilterClick,
sortOptions,
sortSelected,
queryValue = '',
Expand Down Expand Up @@ -405,6 +408,7 @@ export function IndexFilters({
onQueryClear={handleClearSearch}
onQueryFocus={handleQueryFocus}
onQueryBlur={handleQueryBlur}
onAddFilterClick={onAddFilterClick}
filters={filters}
appliedFilters={appliedFilters}
onClearAll={onClearAll}
Expand Down