Skip to content

Commit

Permalink
Make Menu apply styling to top-level div; position same
Browse files Browse the repository at this point in the history
In the interest of controlling placement of the menu, styling supplied
to menu is now applied to the top-level div.

The top-level div is also styled `position: relative;` to fix placement
issues, and the activating menu button now closes the menu when pressed
if its active to work around yet more bugs due to bad
getBoundingClientRect.

Fix #143.
  • Loading branch information
debois committed Aug 12, 2016
1 parent 124df9c commit 58ac249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Material/Menu.elm
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,16 @@ view lift model properties items =
itemSummaries =
List.map (Options.collect defaultItemConfig << .options) items
in
div
Options.apply summary div
( css "position" "relative" :: properties)
[]
[ styled button
[ cs "mdl-button"
, cs "mdl-js-button"
, cs "mdl-button--icon"
, attribute (onKeyDown (Key itemSummaries)) `when` isActive model
, attribute (onClick Geometry.decode (Open)) `when` (model.animationState /= Opened)
, attribute (Html.Events.onClick Close) `when` isActive model
]
[ Icon.view config.icon
[ cs "material-icons"
Expand Down

1 comment on commit 58ac249

@OvermindDL1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoo hoo!

Please sign in to comment.