Skip to content

Commit

Permalink
[Data] Query String Input accepts classname prop (#76848)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
mbondyra and elasticmachine authored Sep 7, 2020
1 parent 05ac18a commit 5a1d075
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ export interface QueryState {
// Warning: (ae-missing-release-tag) "QueryStringInput" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const QueryStringInput: React.FC<Pick<Props_3, "query" | "prepend" | "size" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;
export const QueryStringInput: React.FC<Pick<Props_3, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;

// @public (undocumented)
export type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, { Component, RefObject, createRef } from 'react';
import { i18n } from '@kbn/i18n';

import classNames from 'classnames';
import {
EuiTextArea,
EuiOutsideClickDetector,
Expand Down Expand Up @@ -62,6 +62,7 @@ interface Props {
onSubmit?: (query: Query) => void;
dataTestSubj?: string;
size?: SuggestionsListSize;
className?: string;
}

interface State {
Expand Down Expand Up @@ -586,9 +587,12 @@ export class QueryStringInputUI extends Component<Props, State> {
'aria-owns': 'kbnTypeahead__items',
};
const ariaCombobox = { ...isSuggestionsVisible, role: 'combobox' };

const className = classNames(
'euiFormControlLayout euiFormControlLayout--group kbnQueryBar__wrap',
this.props.className
);
return (
<div className="euiFormControlLayout euiFormControlLayout--group kbnQueryBar__wrap">
<div className={className}>
{this.props.prepend}
<EuiOutsideClickDetector onOutsideClick={this.onOutsideClick}>
<div
Expand Down

0 comments on commit 5a1d075

Please sign in to comment.