fix: cascader active item not expand

pull/197/head
tangjinzhou 2018-09-17 21:17:44 +08:00
parent df5db65397
commit 9be0909031
2 changed files with 4 additions and 4 deletions

View File

@ -365,7 +365,7 @@ export default {
'fieldNames', 'fieldNames',
]) ])
let options = this.options let options = props.options
if (inputValue) { if (inputValue) {
options = this.generateFilteredOptions(prefixCls) options = this.generateFilteredOptions(prefixCls)
} }

View File

@ -92,13 +92,13 @@ export default {
value (val, oldValue) { value (val, oldValue) {
if (!shallowEqualArrays(val, oldValue)) { if (!shallowEqualArrays(val, oldValue)) {
const newValues = { const newValues = {
value: oldValue || [], sValue: val || [],
activeValue: oldValue || [], sActiveValue: val || [],
} }
// allow activeValue diff from value // allow activeValue diff from value
// https://github.com/ant-design/ant-design/issues/2767 // https://github.com/ant-design/ant-design/issues/2767
if (hasProp(this, 'loadData')) { if (hasProp(this, 'loadData')) {
delete newValues.activeValue delete newValues.sActiveValue
} }
this.setState(newValues) this.setState(newValues)
} }