canjs / can-stache

Live binding handlebars templates
https://canjs.com/doc/can-stache.html
MIT License
10 stars 13 forks source link

Late update properties not rendering/updating #685

Closed mikemitchel closed 5 years ago

mikemitchel commented 5 years ago

How often can you reproduce it?

Description: Original issue I encountered was a function call in stache that would set the style attribute on a div was not updating/re-rendering when a property/value that the function call depended on changed later, it did not re-render or update the DOM. In trying to make a simple example (see codePen below), I found that a late updating list also does not render when the values were changed. The nesting of the #if () and #for of() loop in the sample below matches the conditions of my app.

see codePen below

  1. Include a JS Bin (or equivalent) link if possible https://codepen.io/mikemitchel/pen/rbbmQR?editors=1010

Expected results: I would expect the lateUpdateList reference in the stache to render once it has a value.

Actual results: nothing changes

Environment:

Software Version
can-stache version 4.15.2
Browser Chrome 73.0.3683.103 (Official Build) (64-bit)
Operating system Mac OS 10.14.4
bmomberger-bitovi commented 5 years ago

We determined that this is something specific to can-list. Putting listeners on individual numeric properties like happens when you put {{ scope.vm.someList[scope.index] }} does not fire events for the same. Will put a fix in can-list.

bmomberger-bitovi commented 5 years ago

Reopening in can-list as canjs/can-list#90 (PR up at canjs/can-list#91)