angular-slider / angularjs-slider

Slider directive for AngularJS 1.X. No dependencies and mobile friendly.
http://angular-slider.github.io/angularjs-slider
MIT License
1.23k stars 498 forks source link

slider pointers do not resize (reposition) after parent div resize #651

Closed rawbeans closed 5 years ago

rawbeans commented 6 years ago

When the parent div of a slider is resized, some of the slider elements resize with it, but the rz-pointer elements do not.

Correctly resizes:

Does not resize:

However after interacting with the pointers (clicking on the slider, or dragging the pointers) they update to correct positions

Demo: http://jsfiddle.net/mbkjvdfx/

Resize works fine on window resize, but not parent div resize.

ValentinH commented 6 years ago

This is because this library only listen on window resize event. For other events, you have to tell the library when the refresh. Use https://github.com/angular-slider/angularjs-slider#slider-events .

isaacwein commented 5 years ago

Why is the library not exposing a function to be able to re-validate the size from the parent controller like this plonker demo?

ValentinH commented 5 years ago

Indeed this could be possible. What problem does it solves that is not solved by the rzSliderForceRender event though?

ValentinH commented 5 years ago

Closing as there was no answer for a while. Comment to re-open 😉