Skip to content

shouldRemainWhileInvalid does not have an effect for empty values #15

@GuyPaddock

Description

@GuyPaddock

I have an RIEInput defined something like this:

<RIEInput
  value={node.title}
  propName="value"
  shouldRemainWhileInvalid={true}
  validate={(value) => !!value && value.trim().length !== 0}
/>

The outcome I'm trying to achieve is that empty titles are not accepted. However, with this setup, if I provide an empty title and then press Enter or focus out of the control, the blank value is ignored and the component resets back to its previous title. If the component had no title, the component appears as "CLICK TO EDIT".

I want it to stay in edit mode until a non-blank title has been provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions