Skip to content

Switching from null to string field with onUpdate or onEdit validation can fail #229

@zcr1

Description

@zcr1

Background - I have a field that accepts null or the string YYYY-MM-DD

If you have a field with ['null', 'string'] and an initial value of null then changing the type to string both onUpdate and onEdit are called with the string value "null". If this fails the field validation then an error will be shown and editing is exited and returns the field back to null. Which means the user is not able to change the type.

I guess one solution is onEdit should not be called when the type changes, only when a user is done editing. I can also probably figure out a workaround to set a valid value instead when currentValue === null && newValue === 'null'. Is there anything else I am missing?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions