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 27, 2022
1 parent 3ba98f0 commit 7fa168b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,10 @@ export class EuiPopover extends Component<Props, State> {
container,
focusTrapProps,
initialFocus: initialFocusProp,
tabIndex: tabIndexProp,
tabIndex: _tabIndexProp,
...rest
} = this.props;
const tabIndexProp = panelProps?.tabIndex ?? _tabIndexProp;

This comment has been minimized.

Copy link
@cee-chen

cee-chen Oct 27, 2022

Contributor

Fantastic catch on this 👏


const styles = euiPopoverStyles();
const popoverStyles = [styles.euiPopover, { display }];
Expand Down
6 changes: 1 addition & 5 deletions src/components/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type HintPopOverProps = Partial<
| 'repositionOnScroll'
| 'zIndex'
| 'data-test-subj'
| 'id'
>
>;

Expand Down Expand Up @@ -268,9 +267,6 @@ export class EuiSearchBar extends Component<EuiSearchBarProps, State> {

const toolsRightEl = this.renderTools(toolsRight);

const popoverProps: HintPopOverProps | undefined = hint
? { id: this.hintId, ...hint.popoverProps }
: undefined;
const isHintVisible = hint?.popoverProps?.isOpen ?? isHintVisibleState;

return (
Expand All @@ -291,8 +287,8 @@ export class EuiSearchBar extends Component<EuiSearchBarProps, State> {
setIsVisible: (isVisible: boolean) => {
this.setState({ isHintVisible: isVisible });
},
id: this.hintId,
...hint,
popoverProps,
}
: undefined
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/search_bar/search_box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface EuiSearchBoxProps extends EuiFieldSearchProps {
// This is optional in EuiFieldSearchProps
onSearch: (queryText: string) => void;
hint?: {
id: string;
isVisible: boolean;
setIsVisible: (isVisible: boolean) => void;
} & EuiSearchBarProps['hint'];
Expand Down Expand Up @@ -84,6 +85,8 @@ export class EuiSearchBox extends Component<EuiSearchBoxProps> {
'aria-live': undefined,
'aria-modal': false,
role: undefined,
tabIndex: -1,
id: hint.id,
}}
{...hint.popoverProps}
>
Expand Down

0 comments on commit 7fa168b

Please sign in to comment.