Repository navigation
Conversation
schloerke
force-pushed
the
schloerke/bookmark-default
branch
2 times, most recently
from
November 12, 2026 16:08
3a669dd to
fddbe22
Compare
…strap modal With no onBookmarked() callback, Shiny shows the bookmark URL in a Bootstrap modal, and page_react() loads no Bootstrap, so session$doBookmark() / session.bookmark() threw "$(...).modal is not a function". shinyreact does not register a default callback: telling an app's callback from Shiny's fallback needs Shiny's private callback list. Instead, the docs, skill, and the 10-bookmarking example register onBookmarked(function(url) updateQueryString(url)) / session.bookmark.on_bookmarked(session.bookmark.update_query_string), and the bundle fills an empty jQuery.fn.modal so any Shiny modal on a Bootstrap-free page logs a [shinyreact] console error naming that fix. Fixes #326
schloerke
force-pushed
the
schloerke/bookmark-default
branch
from
November 12, 2026 21:13
fddbe22 to
7922d93
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.
When an app registers no
onBookmarked()/on_bookmarked()callback, Shiny shows the bookmark URL in a Bootstrap modal.page_react()loads no Bootstrap, sosession$doBookmark()/session.bookmark()threw$(...).modal is not a function.shinyreact does not register a default callback. To step aside when the app registers its own, it would have to read Shiny's private callback list, and Shiny registers no function of its own to recognize: its modal is a fallback branch inside
doBookmark().Instead:
10-bookmarkingexample now do:onBookmarked(function(url) updateQueryString(url))session.bookmark.on_bookmarked(session.bookmark.update_query_string)jQuery.fn.modalwith a function that logs a[shinyreact]error naming that fix. This covers every Shiny modal (showModal()/modal_show()too). It never replaces an existingmodal, so Bootstrap already on the page wins, and a Bootstrap loaded later overwrites it. The modal's HTML is still dropped, unstyled, at the end of<body>.Playwright tests cover both paths: the documented callback rewrites the URL, and with no callback the
[shinyreact]error is logged andmodal is not a functionis not thrown.