debois / elm-mdl

Elm-port of the Material Design Lite CSS/JS library
Apache License 2.0
965 stars 133 forks source link

Using Textfield inside a lightbox #347

Closed skinnyjames closed 7 years ago

skinnyjames commented 7 years ago

I made a lightbox for my app whose content and visibility can be set via Msg. I'm testing it with a couple Material forms. On a toggle in the main view, the lightbox will populate with a textfield and appear over the screen. I think that the textfield in the lightbox that appears does not respond to onfocus and onblur events, so the labels don't float properly.

Using material libraries in javascript, I would have to reinitialize the handlers to consider the new markup on the page, but I'm not sure how / if this would be done with elm-mdl.

Gist is here I can also do a screen capture if anyone would like to see it.

skinnyjames commented 7 years ago

In case anyone was wondering, my current solution is to implement a js port/hack that calls compontentHandler.upgradeElements(modalfieldslist) wrapped in a setTimeout.

skinnyjames commented 7 years ago

Update: Lost the link, but stumbled on documentation outlining recursive types, which in this case, would allow one to store views in the model - which can then be re-rendered on updates. An implementation of a lightbox can be found here: https://gist.github.com/skinnyjames/5770715a1eebc776f4943f3630e37849