Skip to content

Commit d5cf675

Browse files
committed
feat(applauncher): replace input with search input
1 parent 2a4831a commit d5cf675

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as React from 'react';
22
import { css } from '@patternfly/react-styles';
33
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
4-
import formStyles from '@patternfly/react-styles/css/components/FormControl/form-control';
54
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
65
import { DropdownDirection, DropdownPosition, DropdownToggle, DropdownContext } from '../Dropdown';
76
import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
@@ -10,6 +9,7 @@ import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
109
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
1110
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
1211
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';
12+
import { SearchInput } from '../SearchInput';
1313

1414
export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement> {
1515
/** Additional element css classes */
@@ -93,13 +93,12 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
9393
<div key="search" className={css(styles.appLauncherMenuSearch)}>
9494
<ApplicationLauncherItem
9595
customChild={
96-
<input
96+
<SearchInput
9797
type="search"
98-
className={css(formStyles.formControl)}
9998
placeholder={searchPlaceholderText}
100-
onChange={e => onSearch(e.target.value)}
99+
onChange={value => onSearch(value)}
101100
{...searchProps}
102-
></input>
101+
/>
103102
}
104103
></ApplicationLauncherItem>
105104
</div>

packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface ApplicationLauncherItemProps {
3030
ariaIsNotFavoriteLabel?: string;
3131
/** ID of the item. Required for tracking favorites. */
3232
id?: string;
33+
/** Custom item rendering that receives the ApplicationLauncherContext */
3334
customChild?: React.ReactNode;
3435
/** Flag indicating if hitting enter triggers an arrow down key press. Automatically passed to favorites list items. */
3536
enterTriggersArrowDown?: boolean;

0 commit comments

Comments
 (0)