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.

set value not works with format options

See original GitHub issue

I create a noUiSlider with format option, when try to update the value of the noUiSlider using noUiSlider.set method , the noUiSlider always back to start value passed initially, so when i put the break point on the to function , the value argument is always the value of start option.

format: {
                        to: function (value) {
                         // the value is always  the start option value 
                            return ~~value;
                        },
                        from: function (value) {
                            return ""
                        }
                    }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
leongersencommented, Sep 4, 2016

Your from returns an empty string, removing your input.

Cast to a number instead:

format: {
    to: function (value) {
        return ~~value;
    },
    from: Number
}
0reactions
github-actions[bot]commented, May 29, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-hook-form's setValue method is not working if input is in ...
If I use useForm({defaultValues: {name: prop.value}}) , the default value is only set at the first time, I have to use setValue to...
Read more >
Paste Special option is missing or not working in Microsoft Office
If your Paste Special option is missing, look here. Paste Special allows you to paste using the formatting of your choice.
Read more >
useForm - setValue - React Hook Form
This function allows you to dynamically set the value of a registered field and have the options to validate and update the form...
Read more >
<input type="number"> - HTML: HyperText Markup Language
Any values in the list that are not compatible with the type are not included in the suggested options. The values provided are...
Read more >
Excel conditional formatting formulas based on another cell
How to fix Excel conditional formatting not working ... options such as font style, pattern color and fill effects to set up the...
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