angular-mdc-web icon indicating copy to clipboard operation
angular-mdc-web copied to clipboard

Slider does not work when used in mdc-dialog

Open BrianThorne opened this issue 5 years ago • 2 comments

Describe the bug The slider is locked in the start position showing the max value and I cannot slide to change value.

Screenshots image

What Angular MDC version are you using? 1.05

BrianThorne avatar Jun 22 '19 23:06 BrianThorne

@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 avatar Jun 24 '19 11:06 trimox

@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.

BrianThorne avatar Mar 27 '20 08:03 BrianThorne