diff --git a/packages/core/src/components/Autocomplete/Autocomplete.jsx b/packages/core/src/components/Autocomplete/Autocomplete.jsx index 62515ba3b6..0a47eb68e1 100644 --- a/packages/core/src/components/Autocomplete/Autocomplete.jsx +++ b/packages/core/src/components/Autocomplete/Autocomplete.jsx @@ -4,6 +4,7 @@ import Downshift from 'downshift'; import PropTypes from 'prop-types'; import React from 'react'; import TextField from '../TextField/TextField'; +import classNames from 'classnames'; import uniqueId from 'lodash.uniqueid'; /** @@ -95,9 +96,16 @@ export class Autocomplete extends React.PureComponent { label, loading, children, + className, ...autocompleteProps } = this.props; + const rootClassName = classNames( + 'ds-u-clearfix', + 'ds-c-autocomplete', + className + ); + return ( ( -
+
{this.renderChildren(getInputProps)} {isOpen && (loading || items) ? ( @@ -171,6 +179,11 @@ Autocomplete.propTypes = { */ ariaClearLabel: PropTypes.string, children: PropTypes.node, + /** + * Additional classes to be added to the root element. + * Useful for adding utility classes. + */ + className: PropTypes.string, /** * Clear search text that will appear on the page as part of the rendered `