mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-21 04:31:30 +03:00
don't case now that we use a single constructor
This commit is contained in:
parent
d4625ae274
commit
365d625cca
@ -32,11 +32,9 @@ type FocusTrap
|
|||||||
{-| Attach this attribute to add a focus trap to an HTML element.
|
{-| Attach this attribute to add a focus trap to an HTML element.
|
||||||
-}
|
-}
|
||||||
toAttribute : (String -> msg) -> FocusTrap -> Html.Attribute msg
|
toAttribute : (String -> msg) -> FocusTrap -> Html.Attribute msg
|
||||||
toAttribute focus trap =
|
toAttribute focus (FocusTrap { firstId, lastId }) =
|
||||||
onTab <|
|
onTab <|
|
||||||
\elementId shiftKey ->
|
\elementId shiftKey ->
|
||||||
case trap of
|
|
||||||
FocusTrap { firstId, lastId } ->
|
|
||||||
-- if the user tabs back while on the first id,
|
-- if the user tabs back while on the first id,
|
||||||
-- we want to wrap around to the last id.
|
-- we want to wrap around to the last id.
|
||||||
if elementId == firstId && shiftKey then
|
if elementId == firstId && shiftKey then
|
||||||
|
Loading…
Reference in New Issue
Block a user