mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-07 06:56:53 +03:00
Write out the focus behavior explicitly
the focus still won't handle correctly until we update the checkboxes to take arbitrary attributes, unfortunately
This commit is contained in:
parent
1fcca16f12
commit
a462e9ff04
@ -99,15 +99,12 @@ viewContent :
|
|||||||
-> Modal.FocusableElementAttrs Msg
|
-> Modal.FocusableElementAttrs Msg
|
||||||
-> Html Msg
|
-> Html Msg
|
||||||
viewContent state wrapMsg firstButtonStyle secondButtonStyle focusableElementAttrs =
|
viewContent state wrapMsg firstButtonStyle secondButtonStyle focusableElementAttrs =
|
||||||
|
case ( state.showX, state.showContinue, state.showSecondary ) of
|
||||||
|
( True, True, True ) ->
|
||||||
div []
|
div []
|
||||||
[ if state.showX then
|
[ Modal.closeButton wrapMsg focusableElementAttrs.firstFocusableElement
|
||||||
Modal.closeButton wrapMsg focusableElementAttrs.firstFocusableElement
|
|
||||||
|
|
||||||
else
|
|
||||||
text ""
|
|
||||||
, Modal.viewContent [ viewSettings state ]
|
, Modal.viewContent [ viewSettings state ]
|
||||||
, if state.showContinue && state.showSecondary then
|
, Modal.viewFooter
|
||||||
Modal.viewFooter
|
|
||||||
[ Button.button "Continue"
|
[ Button.button "Continue"
|
||||||
[ firstButtonStyle
|
[ firstButtonStyle
|
||||||
, Button.onClick ForceClose
|
, Button.onClick ForceClose
|
||||||
@ -118,27 +115,84 @@ viewContent state wrapMsg firstButtonStyle secondButtonStyle focusableElementAtt
|
|||||||
, Button.custom focusableElementAttrs.lastFocusableElement
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
else if state.showContinue then
|
|
||||||
Modal.viewFooter
|
|
||||||
[ Button.button "Continue"
|
|
||||||
[ firstButtonStyle
|
|
||||||
, Button.onClick ForceClose
|
|
||||||
, Button.custom focusableElementAttrs.lastFocusableElement
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
else if state.showSecondary then
|
( True, False, True ) ->
|
||||||
Modal.viewFooter
|
div []
|
||||||
|
[ Modal.closeButton wrapMsg focusableElementAttrs.firstFocusableElement
|
||||||
|
, Modal.viewContent [ viewSettings state ]
|
||||||
|
, Modal.viewFooter
|
||||||
[ Button.button "Close"
|
[ Button.button "Close"
|
||||||
[ secondButtonStyle
|
[ secondButtonStyle
|
||||||
, Button.onClick ForceClose
|
, Button.onClick ForceClose
|
||||||
, Button.custom focusableElementAttrs.lastFocusableElement
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
]
|
||||||
|
|
||||||
else
|
( True, False, False ) ->
|
||||||
text ""
|
div []
|
||||||
|
[ Modal.closeButton wrapMsg focusableElementAttrs.firstFocusableElement
|
||||||
|
, Modal.viewContent [ viewSettings state ]
|
||||||
|
]
|
||||||
|
|
||||||
|
( True, True, False ) ->
|
||||||
|
div []
|
||||||
|
[ Modal.closeButton wrapMsg focusableElementAttrs.firstFocusableElement
|
||||||
|
, Modal.viewContent [ viewSettings state ]
|
||||||
|
, Modal.viewFooter
|
||||||
|
[ Button.button "Continue"
|
||||||
|
[ firstButtonStyle
|
||||||
|
, Button.onClick ForceClose
|
||||||
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
( False, True, True ) ->
|
||||||
|
div []
|
||||||
|
[ Modal.viewContent [ viewSettings state ]
|
||||||
|
, Modal.viewFooter
|
||||||
|
[ Button.button "Continue"
|
||||||
|
[ firstButtonStyle
|
||||||
|
, Button.onClick ForceClose
|
||||||
|
, Button.custom focusableElementAttrs.firstFocusableElement
|
||||||
|
]
|
||||||
|
, Button.button "Close"
|
||||||
|
[ secondButtonStyle
|
||||||
|
, Button.onClick ForceClose
|
||||||
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
( False, False, True ) ->
|
||||||
|
div []
|
||||||
|
[ Modal.viewContent [ viewSettings state ]
|
||||||
|
, Modal.viewFooter
|
||||||
|
[ Button.button "Close"
|
||||||
|
[ secondButtonStyle
|
||||||
|
, Button.onClick ForceClose
|
||||||
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
( False, True, False ) ->
|
||||||
|
div []
|
||||||
|
[ Modal.viewContent [ viewSettings state ]
|
||||||
|
, Modal.viewFooter
|
||||||
|
[ Button.button "Continue"
|
||||||
|
[ firstButtonStyle
|
||||||
|
, Button.onClick ForceClose
|
||||||
|
, Button.custom focusableElementAttrs.lastFocusableElement
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
( False, False, False ) ->
|
||||||
|
div []
|
||||||
|
[ Modal.viewContent [ viewSettings state ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user