metal.js icon indicating copy to clipboard operation
metal.js copied to clipboard

Fixes attribute deserialization when using WebComponents | Fixes #292

Open matuzalemsteles opened this issue 6 years ago • 4 comments

I've been looking at issue #292 and I've been noticing that the big problem of using boolean when it is false. In return of the function deserializeValue_ we have OR and as retVal gets false the return is value parameter that contains 'false'.

Note

There are some use cases that want to pass a number value to string, we can force it into the element attribute by passing "'10'", but the deserializeValue_ function receives ''10'' with two single quotes and breaks the JSON.parse, but the correct way would be to pass '"10"' to do the parser correctly.

Please feel free to offer a solution to avoid this.

Current behavior

screen shot 2018-04-25 at 18 28 29

Expected behavior

screen shot 2018-04-25 at 18 28 59

matuzalemsteles avatar Apr 25 '18 23:04 matuzalemsteles

cc @jbalsas

matuzalemsteles avatar Apr 25 '18 23:04 matuzalemsteles

depends on #377

diegonvs avatar May 16 '18 20:05 diegonvs

@matuzalemsteles what’s that repl-ish thing you used to make those screens?

yuchi avatar May 17 '18 09:05 yuchi

hey @yuchi, I was using Scratches.

matuzalemsteles avatar May 17 '18 13:05 matuzalemsteles