Are dialogs supposed to be transparent? #2040
Replies: 5 comments 20 replies
-
Yes, that is normal behavior. Somehow Quasar decided to create transparent dialogs which are usually filled with cards or some other panel. I guess this allows for all kinds of overlays, which wouldn't be possible if a dialog always came with a card. I don't like it too much, but decided to stick with Quasar's default. If we could nest a card automatically, then what is In theory we could create a dialog which contains a card. We could add a with ui.dialog().props('auto-close') as dialog:
dialog.card.classes('bg-gray p-16')
... instead of the more natural with ui.dialog().props('auto-close'):
with ui.card().classes('bg-gray p-16'):
... Long story short: At the moment this normal behavior, but I'm up for suggestions how to improve it. |
Beta Was this translation helpful? Give feedback.
-
Probably the unpopular opinion but instead of a |
Beta Was this translation helpful? Give feedback.
-
I'm a bit lost. What exactly is the problem? Why is the current behaviour problematic (see #2040 (comment))? It's as close as possible to the Quasar API and hence allows all the stying and changes any developer could wish for... |
Beta Was this translation helpful? Give feedback.
-
@rodja - However from other standpoints the current approach is lacking. Why are you forced to create an extra element to make dialog work? What's the point of having a dialog element that doesn't function by itself? It puts more cognitive load on the user to say "ok I wanted 1 dialog, but instead I really have to manage 2 separate components, a dialog and a card". Just make the card implicit. When you create a Chat Message does the user need to create separate elements for the text, the bubble, and the avatar? No. Nicegui takes care of all those elements for you. Dialog should be the same. If a card is required to have a minimal functional dialog, then it should be handled behind the scenes.
Why should nicegui follow the Quasar API as close as possible? Is the goal of nicegui to port Quasar to Python? Or is it to provide a python toolkit for building UIs? As an end user I can proudly say that I'm lazy and want to think about the framework as little as possible! 😄 My focus is on my own app logic. That's my perspective. Obviously you're free to take a different approach. Just sharing for you to consider. Hope this helps. ✊ |
Beta Was this translation helpful? Give feedback.
-
So it's mainly a naming issue? If we would rename |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Is this expected behavior?
I ran the dialog example from the docs, with one small change. I removed ui.card from the dialog because it seemed unnecessary.
Result : dialog was completely transparent. Just floating text 'Hello world!' in the middle of page. Can see the image behind it completely.
Is this intended behavior or some bug on my system? What purpose does a transparent dialog serve?
Beta Was this translation helpful? Give feedback.
All reactions