Skip to content

Commit cf72694

Browse files
authored
Merge pull request #3108 from kenshima4/layout-accept-lists-as-component
changed typecheck for list value to use isinstance instead of type
2 parents 98d30e1 + 1354303 commit cf72694

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

dash/dash.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,17 +2342,21 @@ def update(pathname_, search_, **states):
23422342

23432343
# Set validation_layout
23442344
if not self.config.suppress_callback_exceptions:
2345-
self.validation_layout = html.Div(
2346-
[
2347-
page["layout"]() if callable(page["layout"]) else page["layout"]
2348-
for page in _pages.PAGE_REGISTRY.values()
2349-
]
2350-
+ [
2345+
layout = self.layout
2346+
if not isinstance(layout, list):
2347+
layout = [
23512348
# pylint: disable=not-callable
23522349
self.layout()
23532350
if callable(self.layout)
23542351
else self.layout
23552352
]
2353+
2354+
self.validation_layout = html.Div(
2355+
[
2356+
page["layout"]() if callable(page["layout"]) else page["layout"]
2357+
for page in _pages.PAGE_REGISTRY.values()
2358+
]
2359+
+ layout
23562360
)
23572361
if _ID_CONTENT not in self.validation_layout:
23582362
raise Exception("`dash.page_container` not found in the layout")

0 commit comments

Comments
 (0)