diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx index 300b8e3d751..fbdd6548ce8 100644 --- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx +++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { css } from '@patternfly/react-styles'; import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher'; -import formStyles from '@patternfly/react-styles/css/components/FormControl/form-control'; import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon'; import { DropdownDirection, DropdownPosition, DropdownToggle, DropdownContext } from '../Dropdown'; import { DropdownWithContext } from '../Dropdown/DropdownWithContext'; @@ -10,6 +9,7 @@ import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator'; import { ApplicationLauncherItem } from './ApplicationLauncherItem'; import { ApplicationLauncherContext } from './ApplicationLauncherContext'; import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites'; +import { SearchInput } from '../SearchInput'; export interface ApplicationLauncherProps extends React.HTMLProps { /** Additional element css classes */ @@ -93,13 +93,7 @@ export class ApplicationLauncher extends React.Component onSearch(e.target.value)} - {...searchProps} - > + onSearch(value)} {...searchProps} /> } > diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx index 98db6da18e6..28854b1d579 100644 --- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx +++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx @@ -30,6 +30,7 @@ export interface ApplicationLauncherItemProps { ariaIsNotFavoriteLabel?: string; /** ID of the item. Required for tracking favorites. */ id?: string; + /** Custom item rendering that receives the ApplicationLauncherContext */ customChild?: React.ReactNode; /** Flag indicating if hitting enter triggers an arrow down key press. Automatically passed to favorites list items. */ enterTriggersArrowDown?: boolean; diff --git a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx index b8c255369fe..2f3c13e5376 100644 --- a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx +++ b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx @@ -40,7 +40,10 @@ export const ApplicationLauncherFavoritesAndSearch: React.FunctionComponent = () const [favorites, setFavorites] = React.useState([]); const [filteredItems, setFilteredItems] = React.useState(null); - const onToggle = (isOpen: boolean) => setIsOpen(isOpen); + const onToggle = (isOpen: boolean) => { + setIsOpen(isOpen); + setFilteredItems(null); + }; const onFavorite = (itemId: string, isFavorite: boolean) => { let updatedFavorites: string[] = [...favorites, itemId];