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

Bookmarking bug (or documentation required): only last setBookmarkExclude() is respected #2323

Open
daattali opened this issue Feb 7, 2019 · 4 comments

Comments

@daattali
Copy link
Contributor

daattali commented Feb 7, 2019

I have an app with several inputs that have long names that I want to exclude from bookmarking. I didn't see anywhere in the documentation, online or in roxygen, that setBookmarkExclude() should only be called once, so I assumed I would be able to call the function many times in a row. It turns out that it overwrites the previous ones. So something like this

setBookmarkExclude("t1")
setBookmarkExclude("t2")
setBookmarkExclude("t3")

Will only exclude t3 from bookmarking. Either this is a bug, or it should be mentioned in the documentation that this will not work. Maybe it is mentioned somewhere and I just didn't see it!

@jcheng5
Copy link
Member

jcheng5 commented Jul 29, 2020

You can do this like so today:

setBookmarkExclude(c(session$getBookmarkExclude(), "t1")
setBookmarkExclude(c(session$getBookmarkExclude(), "t2")
setBookmarkExclude(c(session$getBookmarkExclude(), "t3")

Also, note that setBookmarkExclude only overwrites other calls to setBookmarkExclude within the same module--or, if called at the top-level server function, it overwrites other calls from the top-level server function.

@jcheng5
Copy link
Member

jcheng5 commented Jul 29, 2020

This works too 😂

moduleServer(NULL, function(input, output, session) {
  setBookmarkExclude("t1")
})
moduleServer(NULL, function(input, output, session) {
  setBookmarkExclude("t2")
})
moduleServer(NULL, function(input, output, session) {
  setBookmarkExclude("t3")
})

@daattali
Copy link
Contributor Author

Eek. I agree with the tears part of the emoji, not with the smiling part.

@daattali
Copy link
Contributor Author

If I write a shiny app, then it is possible for me to list exclude all the IDs I want.

But what about as a package author? If I create inputs in a package, and I want any future user who writes a shiny app that uses my package to not include these inputs in their bookmarks, is there a way to achieve that?

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

No branches or pull requests

4 participants