From c8e245629cd50cd9964742b7decfcc0c5795780c Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Thu, 11 Apr 2019 13:06:51 -0700 Subject: [PATCH] Use the pnaelId helper to get the labels --- src/Nri/Ui/SlideModal/V2.elm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Nri/Ui/SlideModal/V2.elm b/src/Nri/Ui/SlideModal/V2.elm index 03cae9ee..db3ca7fb 100644 --- a/src/Nri/Ui/SlideModal/V2.elm +++ b/src/Nri/Ui/SlideModal/V2.elm @@ -129,16 +129,14 @@ summarize panels current = viewModal : Config msg -> State -> Summary -> Html msg viewModal config ((State { previousPanel }) as state) summary = let - ( labelledById, currentPanel ) = - ( panelId summary.current - , [ viewIcon summary.current.icon - , Text.subHeading - [ span [ Html.Styled.Attributes.id (panelId summary.current) ] [ Html.text summary.current.title ] - ] - , viewContent summary.current.content - , viewActiveFooter summary |> Html.map config.parentMsg - ] - ) + currentPanel = + [ viewIcon summary.current.icon + , Text.subHeading + [ span [ Html.Styled.Attributes.id (panelId summary.current) ] [ Html.text summary.current.title ] + ] + , viewContent summary.current.content + , viewActiveFooter summary |> Html.map config.parentMsg + ] in Keyed.node "div" [ css @@ -151,7 +149,7 @@ viewModal config ((State { previousPanel }) as state) summary = ] , Role.dialog , Widget.modal True - , labelledBy labelledById + , labelledBy (panelId summary.current) ] (case previousPanel of Just ( direction, panelView ) -> @@ -172,13 +170,13 @@ viewModal config ((State { previousPanel }) as state) summary = ] ) |> Tuple.mapSecond (Html.map (\_ -> config.parentMsg state)) - , ( labelledById + , ( panelId summary.current , panelContainer config.height [ Slide.animateIn direction ] currentPanel ) ] Nothing -> - [ ( labelledById + [ ( panelId summary.current , panelContainer config.height [] currentPanel ) ]