diff --git a/components/cascader/__tests__/__snapshots__/demo.test.js.snap b/components/cascader/__tests__/__snapshots__/demo.test.js.snap index e03a8e0158..14c593e25d 100644 --- a/components/cascader/__tests__/__snapshots__/demo.test.js.snap +++ b/components/cascader/__tests__/__snapshots__/demo.test.js.snap @@ -209,6 +209,7 @@ exports[`renders ./components/cascader/demo/default-value.md correctly 1`] = ` > Zhejiang / Hangzhou / West Lake diff --git a/components/cascader/__tests__/__snapshots__/index.test.js.snap b/components/cascader/__tests__/__snapshots__/index.test.js.snap index c39cdae51c..91b22f9010 100644 --- a/components/cascader/__tests__/__snapshots__/index.test.js.snap +++ b/components/cascader/__tests__/__snapshots__/index.test.js.snap @@ -1117,6 +1117,7 @@ exports[`Cascader support controlled mode 1`] = ` > Zhejiang / Hangzhou / West Lake diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 517328f8bb..d5be7cc3e7 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -316,7 +316,7 @@ class Cascader extends React.Component { }; getLabel() { - const { options, displayRender = defaultDisplayRender as Function } = this.props; + const { options, displayRender = defaultDisplayRender } = this.props; const names = getFilledFieldNames(this.props); const { value } = this.state; const unwrappedValue = Array.isArray(value[0]) ? value[0] : value; @@ -618,9 +618,15 @@ class Cascader extends React.Component { inputIcon = ; } + const label = this.getLabel(); const input: React.ReactElement = children || ( - {this.getLabel()} + + {label} + Zhejiang / Hangzhou / West Lake diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index e1f336cdc1..7c5eb15c62 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -632,6 +632,7 @@ Array [ > Zhejiang / Hangzhou / West Lake