UNPKG

react-bootstrap-typeahead

Version:
10 lines (9 loc) 334 B
import getOptionProperty from './getOptionProperty'; function getIsOnlyResult(props) { const { allowNew, highlightOnlyResult, results } = props; if (!highlightOnlyResult || allowNew) { return false; } return results.length === 1 && !getOptionProperty(results[0], 'disabled'); } export default getIsOnlyResult;