Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shiny interactions #2

Open
schloerke opened this issue Jan 26, 2022 · 1 comment
Open

Shiny interactions #2

schloerke opened this issue Jan 26, 2022 · 1 comment

Comments

@schloerke
Copy link

Running the two button example on the README works great! Very cool / clean to see how it works with custom tags and how you leverage the Lit classes.


I worry that the feature of allowing for two elements of the same name being able to send values back to shiny is more of a bug than a feature. For example: Using bookmarks. Let's say the bookmark data has btn=4...

  • Which btn will restore the value? How will it restore the value?
  • What if the other btn had a value of 7 while the first button had a value of 4?
  • Will all other btn values be set back to 0?

This idea extends to {shinytest}. {shinytest} will not be able to set any input values via an InputBinding. Currently, testing on a {litter} component will only be able to set an input with the allowInputNoBinding = TRUE flag set. Ex:

app$setInputs(btn = 4, allowInputNoBinding_ = TRUE)

I agree with @etiennebacher on the name association. My first thought was not a puppy litter. Maybe {litr}? It would be pronounced the same and tie closer to Lit?

@JohnCoene
Copy link
Member

Hi Barret,

Thanks for the feedback!

I had not considered things like the bookmarks, it'd probably break this along with many other things.
Stupid question, how does shiny pick up which inputs to include in the bookmark and elsewhere?
Would it pick up on these?

Perhaps it should be cleaner, and use something else than Shiny's input system?
I'm not sure how to approach this issue, I think there is potential for something.

I've added you to a repository if you want to take a look at the issue I explain to Etienne.
I'm not sure how I'd go about this in pure shiny in a sensible manner.
Perhaps I'm also doing it wrong in JavaScript, any input is welcome.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants