From a4a7c78ade7336c84a6de96bdc6458345533da93 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 26 Jul 2024 11:53:57 -0400 Subject: [PATCH 1/2] allow for duration to be and passed to client --- shiny/ui/_notification.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shiny/ui/_notification.py b/shiny/ui/_notification.py index e8ac05e47..7f08e1bdd 100644 --- a/shiny/ui/_notification.py +++ b/shiny/ui/_notification.py @@ -85,7 +85,9 @@ def notification_show( "type": type, } - if duration: + if duration is None: + payload.update({"duration": None}) + elif duration: payload.update({"duration": duration * 1000}) session._send_message_sync({"notification": {"type": "show", "message": payload}}) From 5c798dbe650d19e0b2b34cb52e383399dbfd4132 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 26 Jul 2024 11:59:39 -0400 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00bc4d622..39868f90b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,13 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes -* An empty `input_date()` value no longer crashes Shiny. (#1528) +* An empty `ui.input_date()` value no longer crashes Shiny. (#1528) * Fixed bug where calling `.update_filter(None)` on a data frame renderer did not visually reset non-numeric column filters. (It did reset the column's filtering, just not the label). Now it resets filter's label. (#1557) * Require shinyswatch >= 0.7.0 and updated examples accordingly. (#1558) -* `input_text_area(autoresize=True)` now resizes properly even when it's not visible when initially rendered (e.g. in a closed accordion or a hidden tab). (#1560) +* `ui.input_text_area(autoresize=True)` now resizes properly even when it's not visible when initially rendered (e.g. in a closed accordion or a hidden tab). (#1560) + +* `ui.notification_show(duration=None)` now persists the notification until the app user closes it. (#1577) ### Bug fixes