Skip to content

Slider disabled state not honoured without change #7943

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

Closed
cparkinsonMYCM opened this issue May 11, 2023 · 3 comments · Fixed by #7947
Closed

Slider disabled state not honoured without change #7943

cparkinsonMYCM opened this issue May 11, 2023 · 3 comments · Fixed by #7947

Comments

@cparkinsonMYCM
Copy link

Reproduction link

https://stackblitz.com/edit/angular-axq7am

Steps to reproduce

  • Have the nzDisabled attribute on the slider component be set to true when the component is initialized.
  • See the slider is visually in a disabled state (it is grey)
  • Drag the handle, see that the field is not disabled.

What is expected?

Initial state of true for nzDisabled should correctly disable the field.

What is actually happening?

If the value of the nzDisabled attribute is initially set to true the slider looks like it is disabled but the handles are draggable which updates the field value.
When the state of nzDisabled is changed (Either by defaulting to false and changing to true, or by being toggled twice from true to false to true) then the disabled state is applied correctly and the handles are not draggable.
The same is true of the range-slider too.

Environment Info
ng-zorro-antd 15.1.0
Browser Chrome
@OriginRing
Copy link
Collaborator

看起来是首次disable=true 是无效的,后面改变disable的值便恢复正常了

@Laffery
Copy link
Collaborator

Laffery commented May 15, 2023

看起来是首次disable=true 是无效的,后面改变disable的值便恢复正常了

#7786 的副作用,slider.component.ts#L237 要用 nzDisabled

@Laffery Laffery assigned Laffery and OriginRing and unassigned Laffery May 15, 2023
OriginRing added a commit to OriginRing/ng-zorro-antd that referenced this issue May 15, 2023
MunMunMiao pushed a commit to MunMunMiao/ng-zorro-antd that referenced this issue May 31, 2023
@huuluantvka2
Copy link

nz-sdiler init invalid, it just work when component did mount
try it, it work well for me
ngAfterViewChecked() {
this.disabled = true
}

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

Successfully merging a pull request may close this issue.

4 participants