elm-mdl icon indicating copy to clipboard operation
elm-mdl copied to clipboard

Docs & demo for Layout, Menu should emphasize subscriptions

Open debois opened this issue 7 years ago • 7 comments

People regularly report bugs on the elm-slack that resizing breaks Layout in various ways, or menus don't click to close because they have not set up subscriptions.

Demo should include subscription set up and a big notice at the top; docs should have a similar notice.

debois avatar Aug 13 '16 20:08 debois

Excepting my ProgramEx that can register everything at once without issue or forgetting possible things like subscription, can you think of a way to throw some kind of error if the elm-mdl subscription is not added in?

OvermindDL1 avatar Aug 13 '16 23:08 OvermindDL1

That'd be by far the best, of course. However, I can't think of a way to detect whether subscriptions were set-up or not?

debois avatar Aug 14 '16 10:08 debois

I was trying to figure out the same thing, the lack of metaprogramming/macros in Elm is exceedingly limiting... Although HKT's are far more important, it really needs those.

OvermindDL1 avatar Aug 14 '16 15:08 OvermindDL1

Note: also init.

debois avatar Aug 15 '16 03:08 debois

Here's what need to be done:

  • [ ] Add setup code sample to Layout Demo (subscriptions, init, maybe tab sizing)
  • [ ] Add text prominently in the Layout Demo indicating need for subscriptions, init
  • [ ] Add setup code sample to Menu Demo (subscriptions)
  • [ ] Add text prominently in the Menu demo

debois avatar Aug 15 '16 08:08 debois

Mind if I tackle this @debois? Just ran into the problem myself, but figured it out by digging through: https://github.com/debois/elm-mdl/blob/v8/demo/Demo.elm

felixakiragreen avatar Mar 14 '17 19:03 felixakiragreen

I ran into an issue recently and has taken me a few hours to figure out. My fixedDraw was open by default on small screens and not rendering correctly.

Eventually found the issue thanks to @dubert's comment. Particularly I wasn't using the Material init function as in https://github.com/debois/elm-mdl/blob/60736e03ad44bb0f28fe6e8ad7c8b22203d29fe8/demo/Demo.elm#L487

I had the layout subscription, and updated that to the Material subscription. Leaving this comment here in case it helps someone else.

Definitely in support of the docs having way more detail about setting things up correctly - right now it's hard to figure out where problems actually are.

XertroV avatar Sep 21 '17 01:09 XertroV