juba / shinyglide

Glide.js component for Shiny apps
https://juba.github.io/shinyglide/
91 stars 8 forks source link

Touchscreen swipe action #27

Closed riskcede closed 3 years ago

riskcede commented 3 years ago

Thanks for a wonderful library!

Ive just started using it today, created a small app to capture inputs from the user and then write to a database. It works fine on my mac, but when the app is accessed from my ipad the navigation between screens gets a bit buggy.

I use a button on the last screen to move back to the first page just like your demo app.

https://data.nozav.org/app/shinyglide/04_custom_controls/

This app shows the same behaviour on the tablet. If i swipe right until the last page, the 'reload' button takes me to the second page, sometimes to the correct page and other times its completely unstable.

Im not sure if this is related to the touch screen, but it it possible to disable swipe navigation as with keyboard navigation?

Thanks

Regards Jan

juba commented 3 years ago

Sorry, I can't reproduce the problem on the sample app, but I just added a swipe argument to the glide() function. Setting it to FALSE should disable swiping entirely.

Let me know if it doesn't work for you.

riskcede commented 3 years ago

wow, thanks! It works perfectly now, it takes me back to the first page now each time i click the ‘reload’ button in the last page.

I guess the button can be on any page, but im talking about this div.

                                                                             div(`data-glide-el`="controls",
                                                                                 tags$button(id = "fwa_new_case", 
                                                                                             type = "button", 
                                                                                             class = "btn action-button btn-large btn-done", 
                                                                                             `data-glide-dir`="<<", href="#", "Submit")
                                                                             )

It definitely fixed the issue that I had.

Thank you again.

On 2021 Sep 23, at 19:07, Julien Barnier @.***> wrote:

Sorry, I can't reproduce the problem on the sample app, but I just added a swipe argument to the glide() function. Setting it to FALSE should disable swiping entirely.

Let me know if it doesn't work for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/juba/shinyglide/issues/27#issuecomment-925998119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMU6SXAR3ZQCJOTWTNIJOILUDNND3ANCNFSM5ETYXD6A. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.