Repository navigation
Conversation
schloerke
force-pushed
the
schloerke/bookmark-default
branch
from
November 9, 2026 21:41
eb52611 to
3a669dd
Compare
… modal Shiny's default onBookmarked action shows the URL in a Bootstrap modal, and page_react() loads no Bootstrap, so session$doBookmark() / session.bookmark() threw "$(...).modal is not a function". The shinyreact.init handler now registers a default that calls updateQueryString() / update_query_string(), and steps aside once the app registers its own callback. Fixes #326
schloerke
force-pushed
the
schloerke/bookmark-default
branch
from
November 12, 2026 16:08
3a669dd to
fddbe22
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes posit-dev/shinyreact#326.
Shiny's default
onBookmarked/on_bookmarkedaction shows the URL in a Bootstrap modal.page_react()loads no Bootstrap, sosession$doBookmark()/session.bookmark()threw$(...).modal is not a functionand the URL was never shown or updated.The per-session
shinyreact.inithandler (R and Python) now registers a defaultonBookmarkedcallback that writes the URL to the address bar (updateQueryString()/update_query_string()).Shiny only runs its own default when no callback is registered, and runs every callback otherwise. So this callback only acts while it is the only one. If the app registers its own
onBookmarked(), the app's callback alone decides what happens, just as it would replace Shiny's default. Counting callbacks reads a private field in both languages (private$bookmarkedCallbacks/_on_bookmarked_callbacks), since neither has a public way to count them.This also applies to a
page_react_html()document that loads Bootstrap itself, so those apps get the address-bar behavior instead of the modal too.Checked by hand with the issue's R repro and a Python
ReactApp(bookmark_store="url")app: clicking Bookmark updates the URL with no error.