You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shiny/bookmark/_button.py
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ def input_bookmark_button(
39
39
disabled
40
40
Whether the button is disabled.
41
41
id
42
-
An ID for the bookmark button. The only time it is necessary to set the ID unless you have more than one bookmark button in your application. If you specify an input ID, it should be excluded from bookmarking with `session.bookmark.exclude.append(ID)`, and you must create a reactive effect that performs the bookmarking (`session.bookmark()`) when the button is pressed.
42
+
An ID for the bookmark button. This should only be provided when multiple buttons are needed (or used inside a module). See the note on multiple buttons.
43
43
title
44
44
A tooltip that is shown when the mouse cursor hovers over the button.
45
45
kwargs
@@ -50,6 +50,30 @@ def input_bookmark_button(
50
50
:
51
51
A UI element.
52
52
53
+
Multiple (module) buttons
54
+
-------------------------
55
+
56
+
By default, Shiny will listen for the default `id` being used and call
57
+
`session.bookmark()` on button click. However, this will not work if the bookmark
58
+
button is used within a module or more than one bookmark button is being utilized.
59
+
60
+
For both situations, a custom `id` value is required.
61
+
62
+
There are two recommendations to maintain the expected bookmark behavior:
63
+
* The supplied `id` value should be excluded from bookmarking with
64
+
`session.bookmark.exclude.append(ID)`.
65
+
* A reactive effect should be added that performs the bookmarking
66
+
(`session.bookmark()`) when the button is pressed.
0 commit comments