You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an issue in our app where we get annoying flicker in the UI whenever we use list or simpleList from Reflex.Collection. We're using reflex 0.8.0.0 and building with the latest obelisk.
We traced the culprit to the usage of Map.empty in listWithKey:
-- attachWith, not to the updated; if we were using
-- diffMap instead of diffMapNoEq, I think it might not
-- work
, tag (current vals) postBuild
]
listHoldWithKey Map.empty changeVals $\k v ->
mkChild k =<< holdDyn v (select childValChangedSelector $Const2 k)
Basically, what seems to happen is that the value of the Dynamic vals map argument is only used at the PostBuild time instead of being sampled and used in the call to the listHoldWithKey. In our example this leads to a list widget in our UI to initially get rendered as an empty list and then at the next frame to get filled with data, which scrolls all the other widgets that come after it.
We can confirm the problem goes away when using the sampled value of vals when calling listHoldWithKey.
Is this usage of Map.empty intentional, perhaps because of performance reasons? If not I could go ahead and prepare a patch for this.
The text was updated successfully, but these errors were encountered:
We have an issue in our app where we get annoying flicker in the UI whenever we use
list
orsimpleList
fromReflex.Collection
. We're using reflex 0.8.0.0 and building with the latest obelisk.We traced the culprit to the usage of
Map.empty
inlistWithKey
:reflex/src/Reflex/Collection.hs
Lines 75 to 110 in 9b721a5
Basically, what seems to happen is that the value of the Dynamic
vals
map argument is only used at the PostBuild time instead of being sampled and used in the call to thelistHoldWithKey
. In our example this leads to a list widget in our UI to initially get rendered as an empty list and then at the next frame to get filled with data, which scrolls all the other widgets that come after it.We can confirm the problem goes away when using the sampled value of
vals
when callinglistHoldWithKey
.Is this usage of
Map.empty
intentional, perhaps because of performance reasons? If not I could go ahead and prepare a patch for this.The text was updated successfully, but these errors were encountered: