Fork me on GitHub
#re-frame
<
2022-03-01
>
fadrian03:03:21

I've got a re-com datepicker component working correctly. However, when I change the component to datepicker-dropdown, the component, rather than showing a dropdown, disappears. Any idea why this behavior would happen? The model properties are the same for each, so I can't figure out why the dropdown wouldn't work.

Braden Shepherdson03:03:27

bad position: absolute? maybe it needs a position: relative container somewhere?

fadrian10:03:30

I added a :div around the component and it showed up. That seems relatively unintuitive to me. Does anyone have an explanation?

p-himik10:03:45

CSS issues, as Braden described. Maybe positioning, maybe something else. Your best bet it to inspect it with DevTools when it disappears.

p-himik10:03:09

And if you create a minimal reproducible example, please create an issue in re-com's repo with it.

popeye11:03:13

Can we add two events in :on-click function ?

p-himik11:03:14

It's better to combine then in another event. Two ways to do that: • Extract the functionality that the two existing events and the :on-click event share into functions and use those functions in each of the three events • Make the re-frame event that you dispatch on :on-click in turn dispatch those two events

popeye12:03:52

so we cannot do it in a do block?

p-himik12:03:40

You can. But it's the worst solution. The solution with event functionality reuse is the best one. The solution with a third event using the first two is somewhat of a middle ground.