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

SF中禁用状态的Cascader显示异常 #2329

Open
devsharper opened this issue Nov 11, 2022 · 3 comments
Open

SF中禁用状态的Cascader显示异常 #2329

devsharper opened this issue Nov 11, 2022 · 3 comments

Comments

@devsharper
Copy link

Reproduction link

https://stackblitz.com/edit/ng-alain-setup-qnxsnu?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

1、sf,cascader

2、选中某个值

3、sf.getProperty(...)

4、property.schema.readonly = true

5、property.widget.reset(...)

What is expected?

widget变为readonly状态,显示已选中的值

What is actually happening?

widget变为readonly状态,显示空,不显示选中的值,再次启用后又恢复显示

Environment Info
ng-alain 14.1.1
Browser win11,Edge最新版
@alain-bot
Copy link

alain-bot bot commented Nov 11, 2022

Translation of this issue:

Cascader in the state of sf

REPRODUCTION LINK

[https://stackz.com/edit/ng--setup-qnxsnu?file=src%2FAPPP.COPONENT.TS] (https://stackBlitz.com/edit/ng- setup-qnxsnu? file = src%2FAPP%2FAPP.comPonent.ts)

STEPS To Reproduce

  1. SF, Cascader

  2. Select a certain value

3, sf.getproperty (...)

  1. Property.schema.reamonly = true

  2. Property.widget.reset (...)

What is exfected?

Widget becomes readonly state, showing the selected value

What is actually happy?

Widget becomes ReadOnly state, shows empty, does not display the selected value, and then enables it again to resume the display

| ENVIRONMENT | Info |
| --- | --- | |
| ng-alain | 14.1.1 |
| Browser | Win11, Edge latest version |

@cipchk
Copy link
Member

cipchk commented Nov 12, 2022

看起来像是内部 nz-cascader 引起的,如果只是单纯调整 readonly 的话,可以使用:

- prop!.widget.reset(this.sf.value['cityIds']);
+ prop!.widget.detectChanges();

@devsharper
Copy link
Author

@cipchk 测试时意外发现一个有意思的现象,在reset方法之后再给readonly赋值true就没问题,显示正常,详见链接代码,可能问题出在reset方法内?有时间看一下,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants