Closed Leeleevy closed 8 months ago
Thanks for reporting this. Good find, I'll refer to this once I'm building out some Playwright tests for building out behaviors in coming weeks.
https://github.com/ocdevel/gnothi/pull/186
I need to go through the code soon and look for everything that used CoerceNumber
(or worse, didn't use anything; thus using Zod's default resolver). They added z.coerce.number()
helper which fixes this issue, which is especially prevalent with MUI components. Fixed for this one (deploying now), but I'll keep an eye on any other number fields in the app which need to be switched to z.coerce.number()
.
When adding a behaviour or editing an existing one, and choosing "Manual default" in the advanced settings, attempting to enter any value into the "default value" field results in a red frame around the field with an error saying "Expected number, received string" appearing. It then prevents saving of the behaviour, even after you clear the field in case and/or select "Yesterday's Value" or "Average Value" from the drop-down menu. The only way to be able to successfully edit/add a behaviour again is clicking "Cancel" and opening a new "Edit/Add" window, thus having to re-enter all the behaviour data/changes from zero, obviously not touching the "default value" field. The issue persists both on mobile and desktop browsers. I'm open to reword the title of this issue into anything more convenient and informative for the developers if they'll tell me so.