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
Reproduced in a clean 1.3.0. Bug was introduced in 1.3.0.
When wrapping a ternary if in a parenthesis (e.g. <Label text="{{ (data === 0) ? 'off' : 'on' }}"/>), the UI does not react to object changes. When writing the same thing without a parenthesis (<Label text="{{ data === 0 ? 'off' : 'on' }}"/>) it works as it should.
However, on first paint/load, it works with the parenthesis. This inconsistency could be the source of bugs and can be very hard to find (believe me and the hours I spent yesterday...).
Example
This example shows a label and two buttons to change the binding context. If bindingContext.data is 0 the label should read 'off', if it is 1 it should read 'on'. When first navigating to the page, it correctly reads 'off' (as the default value of data is 0). If you change the default value of data to 1 it correctly reads 'on'.
Tapping the "On" or "Off" button which changes the binding context does not update the UI. Removing the parenthesis solves the problem.
I'd say that the expected behavior is that it should work both with or without the parenthesis.
Reproduced in a clean 1.3.0. Bug was introduced in 1.3.0.
When wrapping a ternary
if
in a parenthesis (e.g.<Label text="{{ (data === 0) ? 'off' : 'on' }}"/>
), the UI does not react to object changes. When writing the same thing without a parenthesis (<Label text="{{ data === 0 ? 'off' : 'on' }}"/>
) it works as it should.However, on first paint/load, it works with the parenthesis. This inconsistency could be the source of bugs and can be very hard to find (believe me and the hours I spent yesterday...).
Example
This example shows a label and two buttons to change the binding context. If
bindingContext.data
is0
the label should read 'off', if it is1
it should read 'on'. When first navigating to the page, it correctly reads 'off' (as the default value ofdata
is0
). If you change the default value ofdata
to1
it correctly reads 'on'.Tapping the "On" or "Off" button which changes the binding context does not update the UI. Removing the parenthesis solves the problem.
I'd say that the expected behavior is that it should work both with or without the parenthesis.
The text was updated successfully, but these errors were encountered: