From 9be0909031bb8efb875b10c35a9acb2ac8ba46ab Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 17 Sep 2018 21:17:44 +0800 Subject: [PATCH] fix: cascader active item not expand --- components/cascader/index.jsx | 2 +- components/vc-cascader/Cascader.jsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx index 841b4de4f..aca13e6c8 100644 --- a/components/cascader/index.jsx +++ b/components/cascader/index.jsx @@ -365,7 +365,7 @@ export default { 'fieldNames', ]) - let options = this.options + let options = props.options if (inputValue) { options = this.generateFilteredOptions(prefixCls) } diff --git a/components/vc-cascader/Cascader.jsx b/components/vc-cascader/Cascader.jsx index f8b38b2a9..87a70b1ef 100644 --- a/components/vc-cascader/Cascader.jsx +++ b/components/vc-cascader/Cascader.jsx @@ -92,13 +92,13 @@ export default { value (val, oldValue) { if (!shallowEqualArrays(val, oldValue)) { const newValues = { - value: oldValue || [], - activeValue: oldValue || [], + sValue: val || [], + sActiveValue: val || [], } // allow activeValue diff from value // https://github.com/ant-design/ant-design/issues/2767 if (hasProp(this, 'loadData')) { - delete newValues.activeValue + delete newValues.sActiveValue } this.setState(newValues) }