-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI doesn't look good inside a tab panel #1614
Comments
Is using from nicegui import app, native_mode, ui
app.native.start_args["debug"] = True
# Normal
ui.label("First tab")
ui.label("First tab")
ui.separator()
ui.label("First tab")
ui.button("test1")
ui.button("test2")
ui.separator()
ui.button("test3")
# Not looks good in tabs
with ui.tabs().classes("w-full") as tabs:
one = ui.tab("One")
two = ui.tab("Two")
with ui.tab_panels(tabs, value=one).classes("w-full"):
with ui.tab_panel(one):
with ui.column():
ui.label("First tab")
ui.label("First tab")
ui.separator()
ui.label("First tab")
ui.button("test1")
ui.button("test2")
ui.separator()
ui.button("test3")
with ui.tab_panel(two):
with ui.column():
ui.label("Second tab")
ui.run() |
@natankeddem thanks for pointing out the work around. I think we should still fix the underlying issue in the next release. |
@natankeddem That works, thanks a lot! |
I wasn't sure if this was a bug. When I saw this behavior assumed using a ui.tab_panel should give undefined layout? The standard page container without a wrapper acts similarly a ui.column by default. I guess ui.tab_panel acting the same makes sense. |
In my point of view this is not a bug. Not every element opens a flexbox container with gaps and padding, see So I don't think it is reasonable to make every container a flexbox. But sure, it might be better for While thinking about elements that should render similar to a plain page, I noticed that Long story short, my proposal:
But since these are breaking changes, we should schedule it for 1.4. |
We should also think about using flex layout in |
Description
Test code:
Running result:
![image](https://private-user-images.githubusercontent.com/13740358/267622702-9bd5d46d-cac8-4f8b-a5c6-324925e044c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMTE1NDIsIm5iZiI6MTcyMjIxMTI0MiwicGF0aCI6Ii8xMzc0MDM1OC8yNjc2MjI3MDItOWJkNWQ0NmQtY2FjOC00ZjhiLWE1YzYtMzI0OTI1ZTA0NGMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI5VDAwMDA0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNlMDhhOGQxZGIyMWQ4ODcyMWU4ZTU2OWFlNzgyMzcyZmJjOTBkMjc2ZGUxMjIzYjEwMDgyNmY1MjU5YWRhOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UY6OXw5wD8dE0u80uXFYTEtHNXYZY10S4881YECPsAQ)
Btw, really love this UI framework! 👍
The text was updated successfully, but these errors were encountered: