-
Notifications
You must be signed in to change notification settings - Fork 1.9k
updateQueryString doesn't work with shinylive #4153
Copy link
Copy link
Open
Description
updateQueryString() (or session$updateQueryString) ultimately calls window.history.replaceState() or window.history.pushState(). However, when using shinylive the app is served as an iframe, so window in this case refers to the iframe, not the parent window. Therefore, neither of these calls works and updateQueryString() does nothing. I've found the following works instead:
shinyjs::runjs(paste0("window.parent.history.pushState(null, null, '", pushQueryString, "')"))The MDN docs state that "If a window does not have a parent, its parent property is a reference to itself." Therefore. changing the typescript code to just use window.parent instead of window should fix this problem, regardless of whether you are using shinylive or not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels