It is because you should 'switch' the interface within your dialog to be whatever it needs to be at the time. It is in my opinion a design consideration to prevent multiple dialogs from even being capable of appearing at the same time, which often breaks sites that do that.
But yeah, just inside the dialog just draw whatever type of interface is appropriate at the time. On Thursday, September 8, 2016 at 11:07:49 AM UTC-6, Rupert Smith wrote: > > On Thursday, September 8, 2016 at 4:59:59 PM UTC+1, Rupert Smith wrote: >> >> On Thursday, September 8, 2016 at 4:43:24 PM UTC+1, Rupert Smith wrote: >>> >>> I noticed this in the package docs: >>> >>> - The elm-mdl library currently support only one dialog pr. >>> application. Installing more than one dialog will result in a random one >>> showing. >>> >>> http://package.elm-lang.org/packages/debois/elm-mdl/7.6.0/Material-Dialog >>> >>> Is this still true? Is there a workaround, I am planning on using quite >>> a few dialogs... >>> >> >> Actually, in this case I just wanted a delete / are you sure ? type of >> interaction. A better way might be to add a div below the delete control >> that shows something like "delete 5 items are you sure ? confirm" where the >> confirm is a button, but to just make that part of the page and not a modal >> dialog. Or just make the "delete" button change to "are you sure?" but >> that runs the risk of an accidental double click. >> >> Anyway, it would still be nice to have >1 dialog in an application. >> > > I suppose the question is, is this some inherent limit because of the way > Elm works? or is it just because something was hacked together for dialogs > that is not really complete yet? > > I notice the way to open a dialog is: > > Dialog.openOn "click" > > I'd expected to find something more like > > Button.onClick DialogMsg dialog1 > > to create a Msg for opening the dialog and then in the 'update' function > to respond to that by opening the particular dialog that was selected, > something like this > > DialogMsg -> > Dialog.open dialog > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
