sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
862 stars 43 forks source link

Regression in fields with multiple values #129

Closed greatislander closed 5 months ago

greatislander commented 5 months ago

In the most recent changes (since Friday) I've noticed what appears to be a regression in the way required multiple fields are validated.

Expected behaviour

If a required field which accepts multiple values (list, select with multiple: true, relation with multiple: true) has at least one entry (or min entries if min is greater than 1), validation should succeed.

Actual behaviour

In both circumstances, setting required to false resolves the error and the content can be saved.

Here's a minimal reproduction: https://github.com/greatislander/multiple-validation. I was able to elicit the behaviour I described above in local mode using Chrome (I served the site using npx serve .).

P.S. Thanks for the awesome work on this project. Your efforts to make the editor WCAG 2.2 compliant are deeply appreciated.

kyoshino commented 5 months ago

@greatislander Thanks for reporting! Will check today.

kyoshino commented 5 months ago

I’ve just reverted a commit that caused the regression and shipped v0.19.10. I’ll be reworking the validation code and writing tests soon. Sorry for the inconvenience!