mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-04 12:47:53 +03:00
Close the main menu on escape
This commit is contained in:
parent
643d0a0bc4
commit
ec54e767f9
@ -32,6 +32,7 @@ A togglable menu view and related buttons.
|
||||
-}
|
||||
|
||||
import Accessibility.Styled.Aria as Aria exposing (controls)
|
||||
import Accessibility.Styled.Key as Key
|
||||
import Accessibility.Styled.Role as Role
|
||||
import Accessibility.Styled.Widget as Widget
|
||||
import Css exposing (..)
|
||||
@ -136,7 +137,11 @@ view config =
|
||||
menuId =
|
||||
config.id ++ "-menu"
|
||||
in
|
||||
div (Attributes.id config.id :: styleContainer)
|
||||
div
|
||||
(Attributes.id config.id
|
||||
:: Key.onKeyDown [ Key.escape (config.toggle False) ]
|
||||
:: styleContainer
|
||||
)
|
||||
[ if config.isOpen then
|
||||
div
|
||||
(onClick (config.toggle False)
|
||||
|
Loading…
Reference in New Issue
Block a user