Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
DISPLAYNAME_PREFIX, InputGroup, Keys, Popover, Position, Utils,
} from '@blueprintjs/core';
import { Classes } from '@blueprintjs/select/lib/esm/common';
import { QueryList } from '@blueprintjs/select/lib/esm/components/query-list/queryList';
export class Suggest extends React.PureComponent {
static displayName = `${DISPLAYNAME_PREFIX}.Suggest`;
static defaultProps = {
closeOnSelect: true,
openOnKeyDown: false,
};
TypedQueryList = QueryList.ofType();
refHandlers = {
input: (ref) => {
this.input = ref;
const { inputProps = {} } = this.props;
Utils.safeInvoke(inputProps.inputRef, ref);
},
queryList: ref => (this.queryList = ref),
};
constructor(props, context) {
super(props, context);
this.state = {
isOpen: (props.popoverProps && props.popoverProps.isOpen) || false,
selectedItem: this.getInitialSelectedItem(),
};