DEV Community

Discussion on: Working with menus in elm-ui

Collapse
 
jeremysorensen profile image
JeremySorensen

I am just (as of yesterday) trying to get started in elm-ui. When I saw the issues you were having I was genuinely concerned, because I need to make something almost exactly like what you did here. The main difference is that my menu needs to open on onMouseEnter, and close on onMouseLeave. Turns out responding to those events with the OpenMenu and CloseMenu messages you already have is very easy and gives a good user experience. So you might solve the problem that way (though it is a different behavior than the original "spec"). Also good to note that your solution (with the element in back) gives perfect behavior (I think) for making a combo-box/drop down list. In that case you want the menu to close when they click an item.
In any case it is difficult just to find enough examples of elm-ui to synthesize all the pieces from the docs into a working program so your example is very useful. Thanks!