1

I'm using MDL lite with Halogen. MDL relies mostly on CSS, but it adds some JS for various features.

This has the unfortunate consequences when used with VDom approach. For example, the textfield applies is-dirty class after input had been modified - this, amongst other things, makes the label text not visible (it's displayed similarily to placeholder in the input field by default).

My rendering code is unaware of that, and when it rerenders, this class is dropped, resulting in the label displayed on top of input value.

My immediate solution to this is that I can recreate some of that logic in my components, adding this class as needed. Are there any other approaches? Can we somehow tell the VDom renderer to not touch some elements?

Bartosz
  • 3,318
  • 21
  • 31
  • I'm facing similar obstacles with bootstrap 4 and wondering, how much logic should be put into the Halogen components, how much should or could be relied on css-lib, and is it wise at all to mix the two. Have you been able to work through your problem or have you found an answer to your problem yet? – Gspia Jun 03 '17 at 11:30
  • I'm doing what I described. I'm "duplicating" some logic just to have proper classes after element is rerendered. But I'm also handling certain things in JS - rendering only "bare" element, then apply classes and hook tocertain events in JS. This means Halogen part doesn't really know about all those things, and when it rerenders, it doesn't touch that element - after all, the VDom representation is not changing (it's bare element). – Bartosz Jun 03 '17 at 18:46

0 Answers0