#BUG select field value return string !number

1 messages · Page 1 of 1 (latest)

broken crown
#

I'm working on issue https://github.com/measuredco/puck/issues/713
where a <select><option> value set to a number then in the resolvedData method will instead return a string

I wanted to sanity check, I think the cleanest solve is somewhere like in packages/core/lib/use-resolved-permissions.ts and making a resolveDataForItem for this case?

I'm not familiar is resolveData the only time this value will be evaluated and am I on the right track or way off base? Thank you

GitHub

Using the following configuration the value is being converted to a string { fields: { numberField: { type: "select", // "radio" label: "A Select-Field with numbers", ...

broken crown
#

or resolved-data

hidden olive
#

I think we just need to emulate what we’re doing for Booleans honestly

#

I think it’s not best placed to modify the resolver

#

Although it’ll need to probably refactor a bit as numbers can be infinite

broken crown
#

ahhh simplier ok thank you I started there

#

just wanted to make sure I didnt go down the rabbit hole