Draggable wellPanel and slider in shiny 0.11

262 views
Skip to first unread message

Anders Carlsson

unread,
Jan 23, 2015, 7:43:23 PM1/23/15
to shiny-...@googlegroups.com
Hi,

After updateing to shiny 0.11, I’m having issues with a slider inside a draggable wellPanel. when I try to drag the slider, I also drag the panel. This results that the slider moves relative to the moving panel… Further, when I release the mouse button, only the panel stops and I the slider keeps moving. The only way to let go of the slider is to click somthing else.

Any thoughts on this?

Thanks,
Anders

Anders Carlsson

unread,
Jan 26, 2015, 12:47:07 PM1/26/15
to shiny-...@googlegroups.com
Hi again,

This was solved by me realizing that I had the "draggable = TRUE" inside the absolutePanel that may wellpanel was in, and not the wellPanel itself. By moving it to the wellPanel it now behaves as it did in the previous version of shiny.

Thanks,
Anders

Anders Carlsson

unread,
Jan 26, 2015, 4:43:07 PM1/26/15
to shiny-...@googlegroups.com
OK, turns out that did not help, it only mad me unable to move the absolute panel at all. Here is a UI that replicates my problem - run (in shiny 0.11) and try to move the slider.

Thanks again,
Anders

shinyUI(
  basicPage(
    absolutePanel(
      draggable = TRUE,
      wellPanel(  
        sliderInput("tst", h1("Testing slider"), 
                  min = 0, max = 100, value = 50, step = 1)
      )
    )
  )
)

On Friday, January 23, 2015 at 4:43:23 PM UTC-8, Anders Carlsson wrote:

Joe Cheng

unread,
Jan 26, 2015, 6:21:33 PM1/26/15
to Anders Carlsson, Winston Chang, shiny-...@googlegroups.com
Thanks for the bug report.

Winston: the ionrangeslider's pointerDown callback needs e.stopPropagation() (in addition to e.preventDefault(), which is already being called). We could do a PR on the ionrangeslider library, or we could add an event handler ourselves to the slider element that calls e.stopPropagation().

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/7379b623-41c2-4681-b877-88b581f0d47e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Anders Carlsson

unread,
Jan 27, 2015, 3:22:38 PM1/27/15
to shiny-...@googlegroups.com, nian...@gmail.com, win...@rstudio.com
Great, hope it's an easy fix. 

On that note, as you now use Ion.Range Slider, can I somehow access the "values = []" to set a fixed set of possible values to select in the slider?

Thanks!
Aders

Winston Chang

unread,
Jan 28, 2015, 12:54:26 PM1/28/15
to Joe Cheng, Anders Carlsson, shiny-...@googlegroups.com
Thanks for the report. Issue filed here: https://github.com/rstudio/shiny/issues/711

Winston Chang

unread,
Jan 28, 2015, 4:20:52 PM1/28/15
to Joe Cheng, Anders Carlsson, shiny-...@googlegroups.com
I've pushed a fix for the draggable panel issue.

Regarding setting specific values for the slider, that functionality isn't exposed to sliderInput right now, but that may change in the future. Someone else filed an issue recently:

Anders Carlsson

unread,
Jan 28, 2015, 6:20:57 PM1/28/15
to shiny-...@googlegroups.com, j...@rstudio.com, nian...@gmail.com
Thanks! 

I solved the "setting specific slider values" thing by using the slider as an integer index that then is used to collect the actual value in an other vector. By also displaying the selected value in the slider label using renderText this works pretty well.
Reply all
Reply to author
Forward
0 new messages