Skip to content

Commit

Permalink
Fix url bookmarking with possibility to modify excludes (#3762)
Browse files Browse the repository at this point in the history
* Fix url bookmarking with possibility to modify excludes

* Update NEWS.md
  • Loading branch information
galachad authored Oct 28, 2024
1 parent a145add commit 79af1d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

* `dateInput` and `dateRangeInput` no longer send immediate updates to the server when the user is typing a date input. Instead, it waits until the user presses Enter or clicks out of the field to send the update, avoiding spurious and incorrect date values. Note that an update is still sent immediately when the field is cleared. (#3664)

* Fixed a bug in `onBookmark` hook that caused elements to not be excluded from URL bookmarking. (#3762)

# shiny 1.9.1

## Bug fixes
Expand Down
6 changes: 3 additions & 3 deletions R/bookmark-state.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ saveShinySaveState <- function(state) {

# Encode the state to a URL. This does not save to disk.
encodeShinySaveState <- function(state) {
exclude <- c(state$exclude, "._bookmark_")
inputVals <- serializeReactiveValues(state$input, exclude, stateDir = NULL)

# Allow user-supplied onSave function to do things like add state$values.
if (!is.null(state$onSave))
isolate(state$onSave(state))

exclude <- c(state$exclude, "._bookmark_")
inputVals <- serializeReactiveValues(state$input, exclude, stateDir = NULL)

inputVals <- vapply(inputVals,
function(x) toJSON(x, strict_atomic = FALSE),
character(1),
Expand Down

0 comments on commit 79af1d6

Please sign in to comment.