-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
List widget: Ability to avoid empty entries #1990
Comments
I came across the same issue when using list widget for setting post categories in Hugo. If a user writes anything to the category field and then deletes it, the post header will still contain the following:
This causes Hugo to create a post with an empty category tag, that can look something like this: |
I'm going to test a few possible edge cases such as the list itself having |
@lmcorreia your comment on #2017 is also relevant here. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Fixed by #467. |
(First off, I'm not sure if this is a duplicate of #467 or whether it will be addressed by the efforts to solve that. Feel free to just close it if that's the case -- would make me happy 😄)
Is your feature request related to a problem? Please describe.
When you have a
list
widget, it appears there's no way to validate that list entries aren't left blank. That means that if the user clicks the "Add XXX +" button and forgets to fill in the field, it will end up being persisted as eithernull
or''
(depending on whether the field has been edited, probably due to #1449).This is a problem for "non-technical" people that don't necessarily distinguish between the list entry being empty vs. not being there at all.
Here's an example setup where the problem can be reproduced:
Steps to reproduce:
Causes something like this to be saved:
Describe the solution you'd like
That
required: true
causes a validation error when publishing with list entry field is left without a value.Describe alternatives you've considered
Alternatively unfilled list entries could simply be ignored when persisting.
Additional context
The text was updated successfully, but these errors were encountered: