Make lastId required for disclosure

This commit is contained in:
Brian J. Cardiff 2022-07-08 15:18:15 -03:00
parent 97ead64d23
commit 8ceb7b8e1a
2 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ type alias ButtonConfig =
type Purpose
= NavMenu
| Disclosure { lastId : Maybe String }
| Disclosure { lastId : String }
@ -220,7 +220,7 @@ You will need to pass in the last focusable element in the disclosed content in
You may pass a lastId of Nothing if there is NO focusable content within the disclosure.
-}
disclosure : { lastId : Maybe String } -> Attribute msg
disclosure : { lastId : String } -> Attribute msg
disclosure exitFocusManager =
Attribute (\config -> { config | purpose = Disclosure exitFocusManager })
@ -473,7 +473,7 @@ viewCustom config =
Disclosure { lastId } ->
WhenFocusLeaves.toAttribute
{ firstId = config.buttonId
, lastId = Maybe.withDefault config.buttonId lastId
, lastId = lastId
, tabBackAction =
config.focusAndToggle
{ isOpen = False

View File

@ -255,7 +255,7 @@ view ellieLinkConfig state =
(menuAttributes
++ [ Menu.buttonId "with_controls__button"
, Menu.menuId "with_controls__menu"
, Menu.disclosure { lastId = Just "login__button" }
, Menu.disclosure { lastId = "login__button" }
]
)
{ isOpen = isOpen "with_controls"