mirror of https://github.com/rancher/ui.git
Merge pull request #3527 from codyrancher/one-option-fp
[forwardport] Fix FormContextualSelectArray to accept 1 option
This commit is contained in:
commit
adcfbf96bb
|
|
@ -32,7 +32,7 @@ export default Component.extend({
|
|||
get(this, 'values').removeAt(index);
|
||||
}
|
||||
},
|
||||
lastValue: computed('values', {
|
||||
lastValue: computed('values', 'values.[]', {
|
||||
get() {
|
||||
return get(this, 'values').objectAt(get(this, 'values.length') - 1);
|
||||
},
|
||||
|
|
@ -43,7 +43,8 @@ export default Component.extend({
|
|||
}
|
||||
}),
|
||||
canAddMore: computed('filteredContent', function() {
|
||||
return get(this, 'filteredContent.length') > 1;
|
||||
return get(this, 'filteredContent.length') > 1
|
||||
|| get(this, 'filteredContent.length') > 0 && get(this, 'values.length') === 0;
|
||||
}),
|
||||
lastIndex: computed('values.[]', function() {
|
||||
return get(this, 'values.length') - 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue