Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shouldRemainWhileInvalid does not have an effect for empty values #15

Open
GuyPaddock opened this issue Oct 22, 2019 · 0 comments
Open

Comments

@GuyPaddock
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant