Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Oct 28, 2022
1 parent 7fa168b commit 1205818
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/components/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ interface State {
isHintVisible: boolean;
}

// `state.query` is never null, but can be passed as `null` to `notifyControllingParent`
// when `error` is not null.
type StateWithOptionalQuery = Omit<State, 'query' | 'isHintVisible'> & {
query: Query | null;
type NotifyControllingParent = Pick<State, 'queryText' | 'error'> & {
query: Query | null; // `state.query` is never null, but can be passed as `null` when an error is present
};

export class EuiSearchBar extends Component<EuiSearchBarProps, State> {
Expand Down Expand Up @@ -175,7 +173,7 @@ export class EuiSearchBar extends Component<EuiSearchBarProps, State> {
return null;
}

notifyControllingParent(newState: StateWithOptionalQuery) {
notifyControllingParent(newState: NotifyControllingParent) {
const { onChange } = this.props;
if (!onChange) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/search_bar/search_box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class EuiSearchBox extends Component<EuiSearchBoxProps> {
}}
panelProps={{
'aria-live': undefined,
'aria-modal': false,
'aria-modal': undefined,
role: undefined,
tabIndex: -1,
id: hint.id,
Expand Down

0 comments on commit 1205818

Please sign in to comment.