Skip to content

Commit 629ad06

Browse files
committed
set layout to list if not list already, add to validation_list to pass id content check
1 parent 3ecc548 commit 629ad06

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ VERSION.txt
9292
!components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv
9393
!components/dash-table/tests/assets/*.csv
9494
!components/dash-table/tests/selenium/assets/*.csv
95+
app.py
96+
launch.json

dash/dash.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,6 @@ def _layout_value(self):
719719

720720
@layout.setter
721721
def layout(self, value):
722-
if isinstance(value, list):
723-
value = html.Div(value)
724-
725722
_validate.validate_layout_type(value)
726723
self._layout_is_function = callable(value)
727724
self._layout = value
@@ -2277,17 +2274,21 @@ def update(pathname_, search_, **states):
22772274

22782275
# Set validation_layout
22792276
if not self.config.suppress_callback_exceptions:
2280-
self.validation_layout = html.Div(
2281-
[
2282-
page["layout"]() if callable(page["layout"]) else page["layout"]
2283-
for page in _pages.PAGE_REGISTRY.values()
2284-
]
2285-
+ [
2277+
layout = self.layout
2278+
if not isinstance(layout, list):
2279+
layout = [
22862280
# pylint: disable=not-callable
22872281
self.layout()
22882282
if callable(self.layout)
22892283
else self.layout
22902284
]
2285+
2286+
self.validation_layout = html.Div(
2287+
[
2288+
page["layout"]() if callable(page["layout"]) else page["layout"]
2289+
for page in _pages.PAGE_REGISTRY.values()
2290+
]
2291+
+ layout
22912292
)
22922293
if _ID_CONTENT not in self.validation_layout:
22932294
raise Exception("`dash.page_container` not found in the layout")

0 commit comments

Comments
 (0)