From d5d0b1614d6b30dc5cbfd4d76c9ae6efa64c59af Mon Sep 17 00:00:00 2001 From: huong-li-nguyen Date: Mon, 2 Oct 2023 12:05:11 +0200 Subject: [PATCH] Add another check for empty accordion buttons --- vizro-core/src/vizro/models/_navigation/_accordion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vizro-core/src/vizro/models/_navigation/_accordion.py b/vizro-core/src/vizro/models/_navigation/_accordion.py index 1521bfca1..5ef35d577 100644 --- a/vizro-core/src/vizro/models/_navigation/_accordion.py +++ b/vizro-core/src/vizro/models/_navigation/_accordion.py @@ -54,8 +54,8 @@ def _create_accordion_item(self, accordion_buttons, title=ACCORDION_DEFAULT_TITL ) def _get_accordion_container(self, accordion_items, accordion_buttons): - # Return no container if there is only one page in the dashboard - if len(accordion_buttons) == len(accordion_items) == 1: + # Return no container if there is only one page in the dashboard or no pages exist + if (len(accordion_buttons) == len(accordion_items) == 1) or not accordion_buttons: return None return html.Div(