Skip to content

Commit 2caa64c

Browse files
cpsievertschloerke
andauthored
input_date()'s input handler now handles None more gracefully (#1556)
Co-authored-by: Barret Schloerke <barret@posit.co>
1 parent dc0b294 commit 2caa64c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Bug fixes
1515

16+
* An empty `input_date()` value no longer crashes Shiny. (#1528)
17+
1618
* 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)
1719

1820
* Require shinyswatch >= 0.7.0 and updated examples accordingly. (#1558)

shiny/input_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def _(value, name, session):
9696

9797
@input_handlers.add("shiny.date")
9898
def _(
99-
value: str | list[str], name: ResolvedId, session: Session
99+
value: str | list[str] | None, name: ResolvedId, session: Session
100100
) -> date | None | tuple[date | None, date | None]:
101101

102-
if isinstance(value, str):
102+
if isinstance(value, str) or value is None:
103103
return _safe_strptime_date(value)
104104
else:
105105
return (

0 commit comments

Comments
 (0)