Replies: 4 comments
-
Yes indeed, I'm facing the same weird behavior on iOS... again... |
Beta Was this translation helpful? Give feedback.
-
But... I tried your changes...and it doesn't seem to do the trick... : ( |
Beta Was this translation helpful? Give feedback.
-
It certainly seems that way. But I am still worried that it is not right. |
Beta Was this translation helpful? Give feedback.
-
@lostation <Repeater items="{{ ([42]) }}">
<Repeater.itemTemplate>
<Label text="{{ $value, `1st:${$value == 42} 2nd:${$value === 42}` }}"/>
</Repeater.itemTemplate>
</Repeater>
<!--
As an added bonus, I also found other facts `,` and `=` like bellow causes problems.
<Label text="{{ $value, `1st:${$value == 42}, 2nd:${$value === 42}` }}"/>
<Label text="{{ $value, `=1st:${$value == 42} 2nd:${$value === 42}` }}"/>
--> The result is unexpectedly The reason is that it is converted to an object type here. I don't know how to fix it correctly, but I have worked around this problem with such a patch. export function convertExpressionToValue(expression, model, isBackConvert, changedModel) {
if (!(expression.type in expressionParsers)) {
throw Error('Invalid expression syntax');
}
- return expressionParsers[expression.type](expression, model, isBackConvert, changedModel);
+ const value = expressionParsers[expression.type](expression, model, isBackConvert, changedModel);
+ return (value instanceof Number || value instanceof Boolean || value instanceof String) ? value.valueOf() : value;
} |
Beta Was this translation helpful? Give feedback.
-
NativeScript/packages/core/ui/text-base/index.ios.ts
Line 130 in f88c158
There is difference between iOS and Android.
NativeScript/packages/core/ui/text-base/index.android.ts
Line 259 in f88c158
Since number may be assigned to TextField.text (For example, ListView's item has number 0 field), it is desirable to match Android.
Beta Was this translation helpful? Give feedback.
All reactions