On Thursday, September 8, 2016 at 6:07:49 PM UTC+1, 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
>

Or perhaps it would be better if Dialog had properties for 'open' and 
'closed' and they could be chosen appropriately from the model when 
rendering the view:

dialog
 [ if model.showDialog then Dialog.open else Dialog.close ]
 [ ... ]

?

-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to