Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascader component not rendered the selected label correctly with nzChangeOnSelect option #336

Closed
schsiung opened this issue Sep 20, 2017 · 2 comments · Fixed by #356
Closed
Assignees
Labels

Comments

@schsiung
Copy link

I'm submitting a...


[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Support request => Please do not submit support request here

Current behavior

With the given demo of nz-demo-cascader-change-on-select, I add one middle level leaf node Ningbo,
The options is set as follow:


const options = [{
  value: 'zhejiang',
  label: 'Zhejiang',
  children: [{
    value: 'hangzhou',
    label: 'Hangzhou',
    children: [{
      value: 'xihu',
      label: 'West Lake',
      isLeaf: true
    }],
  },
  {
    value: 'ningbo',
    label: 'Ningbo',
    isLeaf: true
  },
],
}, {
  value: 'jiangsu',
  label: 'Jiangsu',
  children: [{
    value: 'nanjing',
    label: 'Nanjing',
    children: [{
      value: 'zhonghuamen',
      label: 'Zhong Hua Men',
      isLeaf: true
    }],
  }],
}];
  1. First step: I click 'Zhejiang->Hangzhou' in order, then the 'West Lake' option comes in.

  2. Then: I click 'Ningbo' in the middle, the selected label is rendered as "Zhejiang / Ningbo" correctly.

  3. When I open the select menu again, the 'West Lake' option still exist, and if I click the 'West Lake' option directly, the the selected lable is rendered as 'Zhejiang / Ningbo / West Lake', which is not correct

Expected behavior

In the third step, 'West Lake' option disappears or If I click the West Lake option directly,
The selected label becomes 'Zhejiang / Hangzhou / West Lake'

@vthinkxie
Copy link
Member

@fbchen

@lock
Copy link

lock bot commented Feb 19, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants