NG-ZORRO/ng-zorro-antd

Cascader cannot automatically fold the children menu when unselected

Closed this issue · 0 comments

Reproduction link

https://stackblitz.com/edit/angular-e2bizv-ekq4wa?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

Situation One

  • step 1: click the left cascader
  • step 2: click "Zhejiang" option
  • step 3: click "Hangzhou" option
  • step 4: click outside or keyboard (ESCAPE)
  • step 5: click the left cascader again
  • result: The cascader still expended (3 level) instead of collapsing, but in Ant Design, all sub menus will be collapsed and only the first level menu will be displayed.

Situtaion Two

  • step 1: click the right cascader (with default value: Zhejiang - Hangzhou - West Lake)
  • step2: click "Zhejiang" option
  • result: The cascader still expended the sub menus of "Hangzhou", but in Ant Design, the sub menus of "Hangzhou" will collaspe.

Conclusion
be consistent with ant design

What is expected?

  • For situation one:
    If select nothing, cascader should be restore to initial state (only display the first level menu) when opened again.

  • For situation two:
    Only display sub menu of the clicked option, and collaspe unnecessary sub menus.

  • Conclusion:
    be consistent with ant design

What is actually happening?

  • For situation one:
    If select nothing, cascader keep previous expended level when opened again.

  • For situation two:
    still display the unnecessary sub menus.

Environment Info
ng-zorro-antd 18.2.0
Browser Chrome

Although the above mentioned are not serious bugs, they are optimisations and I think Ng Zorro and Ant Design should be designed to be consistent.