Skip to content

Commit b9ecd86

Browse files
committed
updated changelog and docstring
1 parent b8b83e9 commit b9ecd86

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1616
## Added
1717

1818
- [#2630](https://github.com/plotly/dash/pull/2630) New layout hooks in the renderer
19-
- [#2647](https://github.com/plotly/dash/pull/2647) `routing_callback_inputs` allowing to pass more State arguments to the pages routing callback
19+
- [#2647](https://github.com/plotly/dash/pull/2647) `routing_callback_inputs` allowing to pass more Input and/or State arguments to the pages routing callback
2020

2121

2222
## [2.12.1] - 2023-08-16

dash/dash.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ class Dash:
352352
add new States to the routing callback, to pass additional data to the layout
353353
functions. The syntax for this parameter is a dict of State objects:
354354
`routing_callback_inputs={"language": Input("language", "value")}`
355+
NOTE: the keys "pathname_" and "search_" are reserved for internal use.
355356
"""
356357

357358
_plotlyjs_url: str
@@ -2083,14 +2084,16 @@ def router():
20832084
return
20842085
self._got_first_request["pages"] = True
20852086

2087+
inputs = {
2088+
"pathname_": Input(_ID_LOCATION, "pathname"),
2089+
"search_": Input(_ID_LOCATION, "search"),
2090+
}
2091+
inputs.update(self.routing_callback_inputs)
2092+
20862093
@self.callback(
20872094
Output(_ID_CONTENT, "children"),
20882095
Output(_ID_STORE, "data"),
2089-
inputs={
2090-
"pathname_": Input(_ID_LOCATION, "pathname"),
2091-
"search_": Input(_ID_LOCATION, "search"),
2092-
**self.routing_callback_inputs,
2093-
},
2096+
inputs=inputs,
20942097
prevent_initial_call=True,
20952098
)
20962099
def update(pathname_, search_, **states):

0 commit comments

Comments
 (0)