Sha256: d910923619373bf4a8e90bd7146028f46471dbcecb8bfd68819eafe56477ca8a

Contents?: true

Size: 920 Bytes

Versions: 86

Compression:

Stored size: 920 Bytes

Contents

import React, { Component } from 'react';
import { FormControl } from 'patternfly-react';

import { commonInputPropTypes } from '../helpers/commonPropTypes';

class TypeAheadInput extends Component {
  constructor(props) {
    super(props);
    this.handleKeyPress = this.handleKeyPress.bind(this);
  }

  componentDidMount() {
    if (this.ref) {
      this.ref.addEventListener('keydown', this.handleKeyPress);
    }
  }

  componentWillUnmount() {
    if (this.ref) {
      this.ref.removeEventListener('keydown', this.handleKeyPress);
    }
  }

  handleKeyPress(e) {
    this.props.onKeyPress(e);
  }

  render() {
    return (
      <FormControl
        inputRef={(ref) => {
          this.ref = ref;
        }}
        onFocus={this.props.onInputFocus}
        type="text"
        {...this.props.passedProps}
      />
    );
  }
}

TypeAheadInput.propTypes = commonInputPropTypes;

export default TypeAheadInput;

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
katello-4.7.6 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.5 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.8.0.rc2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.4 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.8.0.rc1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.3 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.6.2.1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.6.2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.0 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.6.1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.0.rc2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.7.0.rc1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.4.2.2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.4.2.1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.4.2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.5.1 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.6.0 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
katello-4.6.0.rc2 webpack/components/TypeAhead/pf3Search/TypeAheadInput.js