Closed t-oster closed 1 year ago
This has always been the behavior in knockout, but given that tko does its own parsing of bindings, maybe we can call unwrap
on terminal variable references automatically without creating much of a backwards incompatibility?
I think you misunderstood my question. However the jsfiddle had an error. So compare this one: https://jsfiddle.net/ba3s9zux/4/ (kto) with this one: https://jsfiddle.net/bzndakhx/ (knockout 3)
If the value of x is 'c', the first variant evaluates to false in kto, while it should be true.
This was fixed in #151 — try a newer build: https://cdn.jsdelivr.net/npm/@tko/build.reference@4.0.0-beta1.5/dist/build.reference.min.js
Ok, sorry I used the Version Linked in the readme.
See this jsfiddle:
https://jsfiddle.net/myujpn9t/
Does not work for c:
<span data-bind="visible: x == 'a' || x == 'b' || x == 'c'">OK</span>
Works:<span data-bind="visible: (x == 'a' || x == 'b') || x == 'c'">OK</span>
If you type a or b, it works. If you type c, the first binding does not work: