question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slider position not set on load

See original GitHub issue

Using angular-fullstack I am setting a slider with the scope value like so:

$scope.sliderValue = 100;

and the markup:

        <rzslider rz-slider-model="sliderValue"
            rz-slider-floor="2"
            rz-slider-hide-limit-labels = "false"
            rz-slider-ceil="100"
            rz-slider-always-show-bar="true"></rzslider>

I am displaying the value of the slider on the page and it is correctly set to 100, but the slider position is stuck at 0 until i click on it, then it jumps up to where it’s supposed to be.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:72 (28 by maintainers)

github_iconTop GitHub Comments

7reactions
maknappcommented, May 13, 2016

For the ng-show and tab problems, I have looked into this further and have a solution that gets rid of any flickering. In angularjs v1.2, the slider did not require a timeout and could be force rendered immediately. This is the breaking commit that defers ng-show until the end of the digest cycle.

So, running force render in post digest instead of JavaScript’s next execution cycle (setTimeout) will get rid of any flickering (jsfiddle):

$scope.$$postDigest(function () {
    $scope.$broadcast('rzSliderForceRender');
});

Also, if you want to continue using $setTimeout you should at least stop it from running digest again, since rzSliderForceRender does not require another digest:

$timeout(function () {
    $scope.$broadcast('rzSliderForceRender');
}, 0, false);
4reactions
Dreamerprocommented, Jun 12, 2016

I got over this issue by increasing timeout delay to above 170ms. $timeout(function () { $scope.$broadcast('rzSliderForceRender'); },170); I think this is the rendering time taken in my case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Position of range slider not updating after user interaction
The problem is that if I interact with the range slider to change playback position, the slider will no longer visually move even...
Read more >
Viewer.dims.set_point() not properly updating slider position
I am working on a script to automatically load newly processed tiff images into Napari for live viewing. It is similar to the...
Read more >
<input type="range"> - HTML: HyperText Markup Language
elements of type range let the user specify a numeric value which must be no less than a given value, and no more...
Read more >
Tiny Slider 2 - GitHub Pages
Option Type Description axis “horizontal” | “vertical” Default: “horizontal”. The axis of the slider. gutter positive integer Default: 0. Space between slides (in “px”). edgePadding positive...
Read more >
Options - Splide
Do not set this value if you unsure how this option affects the carousel. ... To make lazy load work, the img element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found