Skip to content

Commit

Permalink
[Filters] Add onQueryFocused callback
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuajay committed Aug 9, 2019
1 parent cc53141 commit 6991354
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Added a new create-react-app example in typescript demonstrating polaris and react-testing ([#1937](https://github.com/Shopify/polaris-react/pull/1937))
- Exported `AppliedFilterInterface` and `FilterInterface` from `Filters` ([#1924](https://github.com/Shopify/polaris-react/pull/1924))
- Improved color contrast of links inside `Banner` ([#1651](https://github.com/Shopify/polaris-react/pull/1651))
- Add `onQueryFocus` callback prop to the `Filters` component ([#1948](https://github.com/Shopify/polaris-react/pull/1948))

### Bug fixes

Expand Down
4 changes: 4 additions & 0 deletions src/components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface Props {
onClearAll(): void;
/** Callback when the query field is blurred */
onQueryBlur?(): void;
/** Callback when the query field is focused */
onQueryFocus?(): void;
/** The content to display inline with the controls */
children?: React.ReactNode;
}
Expand Down Expand Up @@ -133,6 +135,7 @@ class Filters extends React.Component<ComposedProps, State> {
queryValue,
onQueryBlur,
onQueryChange,
onQueryFocus,
focused,
onClearAll,
appliedFilters,
Expand Down Expand Up @@ -236,6 +239,7 @@ class Filters extends React.Component<ComposedProps, State> {
}
onChange={onQueryChange}
onBlur={onQueryBlur}
onFocus={onQueryFocus}
value={queryValue}
focused={focused}
label={
Expand Down

0 comments on commit 6991354

Please sign in to comment.