ractivejs / ractive

Next-generation DOM manipulation
http://ractive.js.org
MIT License
5.94k stars 396 forks source link

Observing escaped keypaths with a wildcard doesn't work properly #3319

Closed ilessiivi closed 5 years ago

ilessiivi commented 5 years ago

Description:

Observing a data model like foo: { "bar.baz": { quuz: 1 } } with an observer like foo.*.quuz doesn't get observed if the last part is an object, or gets called with an old value if the last part is an array (quuz: [1]).

The underlying cause could be an unescaped key in ModelBase.js line 85. I've submitted the pull request #3320 for a possible fix.

Versions affected:

1.3.8, edge

Platforms affected:

Tested on Firefox and Safari (both on macOS)

Reproduction:

https://jsfiddle.net/pwq710hy/1/ (my possible fix is included as an alternative script)

evs-chris commented 5 years ago

Your assessment appears to be spot on. I've merged your PR, and will release updates to the 1.2 and 1.3 branches sometime in the next day or so. Thanks!