Skip to content

Commit

Permalink
Render Dialog element only when dialog tab is active
Browse files Browse the repository at this point in the history
  • Loading branch information
debois committed Aug 3, 2016
1 parent dea51f5 commit c76b0fe
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions demo/Demo.elm
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,17 @@ view' model =
, Html.node "script"
[ Html.Attributes.attribute "src" "assets/highlight.pack.js" ]
[]
, App.map DialogMsg (Demo.Dialog.element model.dialog)
{- Because of limitations on browsers that have non-native (polyfilled)
<dialog> elements, our dialog element /may/ have to sit up here.
-}
, case nth model.selectedTab tabs of
Just ( "Dialog", _, _ ) ->
App.map DialogMsg (Demo.Dialog.element model.dialog)
{- Because of limitations on browsers that have non-native (polyfilled)
<dialog> elements, our dialog element /may/ have to sit up here. However,
running in elm-reactor will never load the polyfill, so we render the
dialog (wrongly if there is no polyfill) only when the Dialog tab is
active.
-}
_ ->
div [] []
]
)

Expand Down

0 comments on commit c76b0fe

Please sign in to comment.