Fork me on GitHub
#membrane
<
2021-03-09
>
jjttjj17:03:36

@smith.adriane It apears the :or in defui isn't always working. At least, when I try to do

(basic/scrollview
  {:scroll-bounds [500 1000]
   :body          [(ui/rectangle 100 100)]})
I get an NPE due to offset being nil when it should be set with the default value here: https://github.com/phronmophobic/membrane/blob/5ee612ae8ab2ff1be3fb7838b1a864d8d771bff6/src/membrane/basic_components.cljc#L483

jjttjj17:03:08

I can file a proper bug report and/or dig a bit deeper if you'd like

jjttjj17:03:26

Strangely there's no NPE when body is just []

phronmophobic18:03:25

@jjttjj, taking a look right now

phronmophobic18:03:42

ok, the issue is because it uses the map argument rather than the destructured binding. I'll create an issue for it. It should work ok if it's called from within a defui.

phronmophobic18:03:56

Are you using the scrollview within a defui? Otherwise, it won't provide the normal scrollview behavior

jjttjj18:03:46

Oh, yeah, I wasn't, I'll give that a shot

phronmophobic18:03:23

Fyi, the scrollview is a bit janky. When you mouse out of the scrollview element, it stops scrolling. If you're planning on using the scrollview, I can make sure to fix that soon.

phronmophobic18:03:49

I don't use scrollviews that often so I've been putting it off, but I feel like scrollviews are one of the first things people try so I should probably just fix it.

jjttjj19:03:43

No problem, I don't have a huge need for the scroll view, I just started using the actual components stuff a bit more and just happened to reach for the scrollview to try it out.

phronmophobic19:03:31

Cool, I would love to know how the component stuff feels as you try it out. It's probably the most experimental part of the library and the hardest piece to get feedback about. All feedback is welcome, especially the stuff you don't like.

jjttjj19:03:38

Sounds good, I'll keep you updated!

jjttjj19:03:15

Btw that Bret Victor talk was excellent

👍 3
jjttjj19:03:47

Though a little sad the landscape feels sort of the same as he described, 8 years later