Skip to content
New issue

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

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

Already on GitHub? # to your account

Front-end validation errors display on some search fields #1899

Open
GuySartorelli opened this issue Feb 12, 2025 · 0 comments
Open

Front-end validation errors display on some search fields #1899

GuySartorelli opened this issue Feb 12, 2025 · 0 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented Feb 12, 2025

For some FormField types (noticed specifically with CurrencyField but bound to be with others as well), there's front-end validation errors that occur on-blur in the search filters in gridfield.

The example screenshot below comes from silverstripe/silverstripe-framework#11602 (review)

example

Steps to reproduce

  • Set up a DataObject with a Currency db field.
  • Add that field as a searchable field
  • make a model admin for the new class
  • Click "Search options", click on the currency field, and then click off it.
  • Behold, a message saying the value isn't valid.

Notes

  • It's unclear whether we should allow some validation here or not. Perhaps engage the UX team?
    • Removing the frontend validation resolves the problem, technically, but reduces the usefulness of these specific form fields if they're explicitly used
    • Keeping the frontend validation could be useful for some scenarios but isn't backed up with backend validation at all
  • You can still submit the form - the error is purely visual
  • None of the default scaffolded search fields should have this problem anymore - but it still happens on explicitly set fields like CurrencyField and probably EmailField
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant