Skip to content

Commit c86079a

Browse files
committed
set layout to list if not list already, add to validation_list to pass id content check
1 parent 35e742b commit c86079a

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
@@ -2284,17 +2281,21 @@ def update(pathname_, search_, **states):
22842281

22852282
# Set validation_layout
22862283
if not self.config.suppress_callback_exceptions:
2287-
self.validation_layout = html.Div(
2288-
[
2289-
page["layout"]() if callable(page["layout"]) else page["layout"]
2290-
for page in _pages.PAGE_REGISTRY.values()
2291-
]
2292-
+ [
2284+
layout = self.layout
2285+
if not isinstance(layout, list):
2286+
layout = [
22932287
# pylint: disable=not-callable
22942288
self.layout()
22952289
if callable(self.layout)
22962290
else self.layout
22972291
]
2292+
2293+
self.validation_layout = html.Div(
2294+
[
2295+
page["layout"]() if callable(page["layout"]) else page["layout"]
2296+
for page in _pages.PAGE_REGISTRY.values()
2297+
]
2298+
+ layout
22982299
)
22992300
if _ID_CONTENT not in self.validation_layout:
23002301
raise Exception("`dash.page_container` not found in the layout")

0 commit comments

Comments
 (0)