react-bootstrap-typeahead
Version:
React typeahead with Bootstrap styling
10 lines (9 loc) • 334 B
JavaScript
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;