I think the problem might lie with your sep
parameter. Is that supposed to be step
? If so, it needs to be either a number or NULL
. I changed that line to the following:
sliderInput("year", "Year", min=2005, max=2040, value=2005, animate=animationOptions(interval=1500), step=1),
It worked fine. At least, I was able to drag as far left as I wanted without any issue. On the other hand, I don't have your server.R
file, so if the problem is there, or with an interaction between the files, I wouldn't see it.
Update:
The problem is with your version of Shiny. I discovered this because the sep
parameter was an "unused argument" when I tried to run the app. I originally thought this was a typo, but your certainty (in your recent comment) caused me to check with the documentation for sliderInput
. You are totally right, sep
is a valid parameter. I figured this meant my version of the shiny
package was out of date, so I updated it. After I updated it, not only did sep
parameter get accepted, but I was able to replicate your issue. I found that if I attempted to drag the slider off of the browser window, its value would change to NaN. Also, the slider looks much prettier. I am guessing this has to do with a change in the code for the sliderInput
function. I will take a look at that and update again if I find the change.
Update2
I found the issue. In the latest version of Shiny, they decided to use a range slider written in jQuery called ion.rangeSlider
. Specifically, they used version 2.0.2. Unfortunately, that version had an issue with returning NaN when the left slider was pulled off of the browser window (sound familiar?). That has been fixed in the most recent version of ion.rangeSlider
(2.0.6). I hope that the next release of the shiny
package incorporates the most recent version of ion.rangeSlider
.
I know this doesn't actually solve your problem. However, the following will:
- Figure out where your R packages are installed
- Go to the subfolder shiny\www\shared\ionrangeslider\css
- Copy the file ion.rangeSlider.skinShiny.css to somewhere else
- delete the contents of shiny\www\shared\ionrangeslider
- Download the .zip of ion.rangeSlider here
- Copy the contents of ion.rangeSlider-master into the ionrangeslider folder mentioned in step 2
- Move ion.rangeSlider.skinShiny.css back into shiny\www\shared\ionrangeslider\css
Then just detach and reload the shiny
package, and you should be all set.