Closed etiennebacher closed 4 years ago
Yes, you can prevent the scrolling behaviour with the normalScrollElements
option. A gist below.
https://gist.github.com/JohnCoene/e3851a83e1ecbf073eb70cff54c9d5b2
Let me know if that works
Thanks but two problems:
options
specified in the gist, and replace "#plot, #hist"
by "#test"
(id of selectInput
), it does not work.options
, which can be tedious if there are many. Also, I think this behavior should be removed for all inputs that need scrolling, such as selectInput
. I hardly see a situation in which this behavior would be desired.I'm limited by what the API of fullPage.js provides so I can't do that automatigically for all inputs.
The reason it does not work with #test
for a selectInput
is that this id is used very differently, see below.
r$> shiny::selectInput("s", "asd", choices = 1:2)
<div class="form-group shiny-input-container">
<label class="control-label" for="s">asd</label>
<div>
<select id="s"><option value="1" selected>1</option>
<option value="2">2</option></select>
<script type="application/json" data-for="s" data-nonempty="">{}</script>
</div>
</div>
Try adding .shiny-input-container
to block scroll on many shiny inputs.
Using normalScrollElements = ".shiny-input-container"
works indeed. Thanks a lot!
Hi, sometimes I have a
selectInput
with lots of choices, and the users need to scroll down these choices. The problem is that scrolling in the list of choices changes the page displayed. For example, in the app below, scrolling up or down inselectInput
on page 2 makes the app go up or down (whether using the mouse or the touchpad):Note that this is also the case with
fullPage
:Is it possible to stop the "page-scrolling behavior" when a
selectInput
(or else) is selected?Great package by the way!