Skip to content

Commit 900da07

Browse files
committed
adjustments specs to dict
1 parent 60f444c commit 900da07

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
88
## Fixed
99
- [#3279](https://github.com/plotly/dash/pull/3279) Fix an issue where persisted values were incorrectly pruned when updated via callback. Now, callback returned values are correctly stored in the persistence storage. Fix [#2678](https://github.com/plotly/dash/issues/2678)
1010

11+
## Added
12+
- [#3294](https://github.com/plotly/dash/pull/3294) Added the ability to pass `allow_optional` to Input and State to allow callbacks to work even if these components are not in the dash layout.
13+
1114
## [3.0.4] - 2025-04-24
1215

1316
## Fixed

dash/dependencies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def component_id_str(self) -> str:
5959

6060
def to_dict(self) -> dict:
6161
specs = {"id": self.component_id_str(), "property": self.component_property}
62-
return {**specs, "allow_optional": True} if self.allow_optional else specs
62+
if self.allow_optional:
63+
specs["allow_optional"] = True
64+
return specs
6365

6466
def __eq__(self, other):
6567
"""

0 commit comments

Comments
 (0)