1 | import getOptionProperty from './getOptionProperty';
|
2 |
|
3 | function getIsOnlyResult(props) {
|
4 | var allowNew = props.allowNew,
|
5 | highlightOnlyResult = props.highlightOnlyResult,
|
6 | results = props.results;
|
7 |
|
8 | if (!highlightOnlyResult || allowNew) {
|
9 | return false;
|
10 | }
|
11 |
|
12 | return results.length === 1 && !getOptionProperty(results[0], 'disabled');
|
13 | }
|
14 |
|
15 | export default getIsOnlyResult; |
\ | No newline at end of file |