Wrap the modal in a new stacking context

in the monolith, there were pages where tooltip triggers were showing through the modal backdrop
This commit is contained in:
Tessa Kelly 2019-08-16 10:06:20 -07:00
parent 898e2b9f65
commit 43c5f27a1a
2 changed files with 8 additions and 6 deletions

View File

@ -7,12 +7,11 @@ module Nri.Ui.Modal.V7 exposing
, closeButton
)
{-| Changes from V5:
{-| Changes from V6:
- Removes button helpers, now that we can use Nri.Ui.Button.V9 directly
These changes have required major API changes. Be sure to wire up subscriptions!
- Modal starts a new stacking context, to prevent non-normal-flow elements from showing through the backdrop
```
import Html.Styled exposing (..)
import Nri.Ui.Button.V9 as Button
import Nri.Ui.Modal.V7 as Modal
@ -49,6 +48,7 @@ These changes have required major API changes. Be sure to wire up subscriptions!
view init
--> text "" -- a closed modal
```
## State and updates
@ -202,6 +202,8 @@ view { overlayColor, titleColor } config model =
}
model
|> fromUnstyled
|> List.singleton
|> div [ css [ Css.position Css.relative, Css.zIndex (Css.int 1) ] ]
toOverlayColor : Css.Color -> String

View File

@ -15,7 +15,7 @@ import ModuleExample exposing (Category(..), ModuleExample)
import Nri.Ui.Button.V9 as Button
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Modal.V6 as Modal
import Nri.Ui.Modal.V7 as Modal
{-| -}
@ -46,7 +46,7 @@ init =
{-| -}
example : (Msg -> msg) -> State -> ModuleExample msg
example parentMessage state =
{ name = "Nri.Ui.Modal.V6"
{ name = "Nri.Ui.Modal.V7"
, category = Modals
, content =
[ Button.button "Launch Info Modal"