How to use the @blueprintjs/select/lib/esm/components/query-list/queryList.QueryList.ofType function in @blueprintjs/select

To help you get started, we’ve selected a few @blueprintjs/select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alephdata / aleph / ui / src / components / common / Suggest.jsx View on Github external
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(),
    };