From aab6c993fb2383e5920221c76d0d9a21b2d8e2a6 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Sat, 7 Dec 2019 09:22:28 +1300 Subject: [PATCH 1/4] Should subscribe to demo textfield subscriptions, else menu won't close --- demo/Demo.elm | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/Demo.elm b/demo/Demo.elm index 50f22073..08e7ffe5 100644 --- a/demo/Demo.elm +++ b/demo/Demo.elm @@ -644,5 +644,6 @@ subscriptions model = , Demo.Slider.subscriptions SliderMsg model.slider , Demo.TabBar.subscriptions TabBarMsg model.tabbar , Demo.ModalDrawer.subscriptions ModalDrawerMsg model.modalDrawer + , Demo.TextFields.subscriptions TextFieldMsg model.textfields , Demo.TopAppBar.subscriptions TopAppBarMsg model.topAppBar ] From 75aa63397ea7a7a2b97590c6d05a874422894a62 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Wed, 11 Dec 2019 09:40:57 +1300 Subject: [PATCH 2/4] Format code better --- src/Internal/Menu/Implementation.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Internal/Menu/Implementation.elm b/src/Internal/Menu/Implementation.elm index f0dfe005..45f2724c 100644 --- a/src/Internal/Menu/Implementation.elm +++ b/src/Internal/Menu/Implementation.elm @@ -337,9 +337,9 @@ menu domId lift model options ulNode = , when (model.animating && not config.quickOpen) <| if model.open then cs "mdc-menu-surface--animating-open" - else cs "mdc-menu-surface--animating-closed" + , -- Note: .mdc-menu--open has to be added one frame after -- .mdc-menu-surface--animating-open has been set, except when -- quickly opening: From 0e0513d1e1ee5bbc9661cd559bf744749a20de4d Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Wed, 11 Dec 2019 09:41:43 +1300 Subject: [PATCH 3/4] Menu focuses itself --- src/Internal/Select/Implementation.elm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Internal/Select/Implementation.elm b/src/Internal/Select/Implementation.elm index 64be4817..5db693ca 100644 --- a/src/Internal/Select/Implementation.elm +++ b/src/Internal/Select/Implementation.elm @@ -80,12 +80,7 @@ update lift msg model = ( Nothing, Cmd.none ) OpenMenu menuIndex -> - ( Nothing - , Cmd.batch - [ Helpers.cmd ( lift (MenuMsg Menu.Open) ) - , Task.attempt (\_ -> lift NoOp) (Browser.Dom.focus menuIndex) - ] - ) + ( Nothing, Helpers.cmd ( lift (MenuMsg Menu.Open) ) ) ToggleMenu -> update lift (MenuMsg Menu.Toggle) model From d43783ccc2645f715cb4782c7702b9502f49b9a0 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Wed, 11 Dec 2019 09:42:37 +1300 Subject: [PATCH 4/4] When ripple disabled, menu/list could not get keyboard focus #279 --- src/Internal/List/Implementation.elm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Internal/List/Implementation.elm b/src/Internal/List/Implementation.elm index 6978157a..a44a6c0b 100644 --- a/src/Internal/List/Implementation.elm +++ b/src/Internal/List/Implementation.elm @@ -427,6 +427,7 @@ liView domId lift model config listItemIds focusedIndex index options children = Options.apply li_summary (Maybe.withDefault Html.li li_config.node) [ listItemClass + , Options.id list_item_dom_id |> when (not rippled) , tabindex tab_index |> when config.isInteractive , cs "mdc-list-item--selected" |> when (config.isSingleSelectionList && is_selected && not config.useActivated) , cs "mdc-list-item--activated" |> when (config.isSingleSelectionList && is_selected && config.useActivated)