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
When using a r-input component, which is very useful to allow the user to input arbitrarily precise values or strings, it always return a string, whether the r-var it was binded to is set as type Number or not.
At first page load, the result shown is Sum: 1111.0, which is correct, because the variables were initialized as numbers. But as soon as any value is changed in any input, the result becomes a string, and hence the sum becomes a concatenation of strings eg: Sum: 1101001000.
Current workarounds include either parsing as float inside the r-display:
A simpler approach would be for r-input to check the r-var type and store as a float if set as a Number.
BTW I did this small test to see how far the reactivity goes and I'm quite impressed that the sum is automatically updated without explicitly binding a callback or a specific variable, IMHO this is amazing and allows for very highly expressive but concise setup of variables and components interactions. An example like the one I produced above could be added in the documentation to show that modifying any variable will automatically update :value aggregates (and not just bindings).
The text was updated successfully, but these errors were encountered:
When using a
r-input
component, which is very useful to allow the user to input arbitrarily precise values or strings, it always return a string, whether ther-var
it was binded to is set as typeNumber
or not.Here is an example:
At first page load, the result shown is
Sum: 1111.0
, which is correct, because the variables were initialized as numbers. But as soon as any value is changed in any input, the result becomes a string, and hence the sum becomes a concatenation of strings eg:Sum: 1101001000
.Current workarounds include either parsing as float inside the
r-display
:Or by parsing as float when the
r-input
components change ther-var
values:A simpler approach would be for
r-input
to check ther-var
type and store as a float if set as aNumber
.BTW I did this small test to see how far the reactivity goes and I'm quite impressed that the sum is automatically updated without explicitly binding a callback or a specific variable, IMHO this is amazing and allows for very highly expressive but concise setup of variables and components interactions. An example like the one I produced above could be added in the documentation to show that modifying any variable will automatically update
:value
aggregates (and not just bindings).The text was updated successfully, but these errors were encountered: