These are chat archives for chandu0101/scalajs-react-components

29th
Dec 2015
Steven Scott
@codingismy11to7
Dec 29 2015 16:38
@Daxten there’s a bug, we fixed it, gonna submit a PR
(re- the table headers and whatnot)
the problem is- if there’s only 1 row, it needs just “child” passed in, not “child.toJSArray"
Øyvind Raddum Berg
@oyvindberg
Dec 29 2015 16:54
aah, that makes sense
i actually fixed that now for the updated material-ui 0.14 wrappers that i havent merged yet
Steven Scott
@codingismy11to7
Dec 29 2015 16:55
oh ok, well i’ll cancel this PR i was about to make
  def apply(children: ReactNode*) = {
    val props = JSMacro[MuiTableHeader](this)
    val f = React.asInstanceOf[js.Dynamic].createFactory(Mui.TableHeader)
        val childOrChildren = {
            if (children.isEmpty)
                js.undefined
            else if (children.size == 1)
                children.head: js.UndefOr[ReactNode]
            else
                children.toJsArray: js.UndefOr[js.Array[ReactNode]]
        }
        f(props, childOrChildren).asInstanceOf[ReactComponentU_]
  }
Øyvind Raddum Berg
@oyvindberg
Dec 29 2015 17:00
hah i hadnt covered the size == 1 case really
Steven Scott
@codingismy11to7
Dec 29 2015 17:07
if you go look at the upstream, they check the size of children, and if it’s size 1 then they don’t expect an array
ah, yeah, exactly like that
Øyvind Raddum Berg
@oyvindberg
Dec 29 2015 17:13
they do nonsense like this elsewhere too
drives me crazy
selected index from a list is either an int or the string "all"
should have revoked that programming license just for that xD
Steven Scott
@codingismy11to7
Dec 29 2015 17:14
yeah, js people /smh
i don’t know how anybody maintains js at all
Steven Scott
@codingismy11to7
Dec 29 2015 17:25
@elacin can’t figure out the new svgicons on 0.3.0 - i did an import chandu0101.scalajs.react.components.materialui.MuiSvgIcon._, but I’m getting
: missing arguments for method apply in class SvgIconApply;
[error] follow this method with `_' if you want to treat it as a partially applied function
[error]             Mui.SvgIcons.ActionSettings(color = iconColor)
Steven Scott
@codingismy11to7
Dec 29 2015 17:31
hrm, left out the final (), but also I have to manually put “.apply” in there, it seems
Steven Scott
@codingismy11to7
Dec 29 2015 17:50
bah, it’s just intellij, scalac works fine without .apply
Øyvind Raddum Berg
@oyvindberg
Dec 29 2015 18:48
yeah i hate those extra () at the end, plus i've seen intellij stumble a bit on that apply too