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.

Dynamic min and max value for handles are not being applied

See original GitHub issue

I am attempting to dynamically change my slider from chronological dates to chronological time. I am able to get the labels and increments correct, but the handles are not changing to their appropriate min and max values that are being set with two binding.

The handles are maintaining their long epoch values from the date even though I have change them in the code below.

<ng5-slider [(value)]="minValue" [(highValue)]="maxValue" [options]="options" (userChange)="onChange($event)"></ng5-slider>

The handles are maintaining their long epoch values from the date even though I have change them in the code below.

this.minValue = 0;
this.maxValue = 1440;

this.options = {
    floor: 0,
    ceil: 1440,
    stepsArray: this.createTimeRange().map((number: number) => {
        return { value: number };
    }),
    translate: (value: number, label: LabelType): string => {
        const hours: number = Math.floor(value/60);
        const hoursString = (hours < 10) ? "0" + hours : "" + hours;
        const minutes: number = value % 60;
        const minutesString = (minutes < 10) ? "0" + minutes : "" + minutes;
        return hoursString + ":" + minutesString;
    },
    showSelectionBar: true,
    noSwitching: true
};

I have looked at your stackblitz examples and I cannot get it to recreate there. The only thing I didn’t recreate were the options variable.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
piotrdzcommented, Jan 14, 2019

A workaround using setTimeout() is possible, but shouldn’t be necessary now. I just released v1.1.12 of slider which should fix this. Can you re-test your code with the new version?

0reactions
bdparrishcommented, Jan 14, 2019

@piotrdz Awesome, looks good and fixes my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery slider problem reaching min and max values
In your 'slide' callback, try using ui.value to get the value. This solved my problem. See jQuery UI slider - can't slide to...
Read more >
Step not working correctly when changing Min/Max - Syncfusion
Now I change at runtime the value of 'Days', to 200, and call StateHasChanged(). The slider reflects the new situation, and I can...
Read more >
A guide to the min(), max(), and clamp() CSS functions
The min(), max(), and clamp() CSS functions can revolutionize web layouts, but they can also make CSS much more difficult to reason about....
Read more >
Dynamic scaling for Amazon EC2 Auto Scaling
Amazon EC2 Auto Scaling supports the following types of dynamic scaling ... that the new capacity never goes outside of the minimum and...
Read more >
Maximum capacity specifications for SQL Server
Maximum values of various objects defined in SQL Server databases, ... size is the size of the tabular data stream (TDS) packets used...
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