angular-mdc-web
angular-mdc-web copied to clipboard
Slider does not work when used in mdc-dialog
Describe the bug The slider is locked in the start position showing the max value and I cannot slide to change value.
Screenshots
What Angular MDC version are you using? 1.05
@BrianThorne Thanks for reporting. Unfortunately, this is a known bug upstream with material-components-web. I did push an update to expose the
layout()` method https://github.com/trimox/angular-mdc-web/commit/93d02c42c63aea0b9434c79692cdf6f36e21be6a, you could experiment with calling that once the dialog is opened.
reference upstream issue - https://github.com/material-components/material-components-web/issues/1017
@trimox I had this working well in a dialog, using the exposed layout() property as you suggested. Now I just updated my project from 3.X to latest and a call to layout() no longer sets the value of the slider.
@ViewChild('slider') slider: MdcSlider;
this.slider.value = 55; this.slider.layout();
Nothing happens. The slider is set to 0. Something was changed in the layout() method that used to set the value, but no longer does.