tinacms / tinacms

A fully open-source headless CMS that supports Markdown and Visual Editing
https://tina.io
Apache License 2.0
11.19k stars 564 forks source link

πŸ› Bug - input validation does not trim whitespaces #4499

Open jeoffreyfischer opened 3 weeks ago

jeoffreyfischer commented 3 weeks ago

Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!

Description Most TinaCMS input boxes do not trim the string that's typed inside them e.g. search feature. This is a problem as searching for "keyword" will result in a success while searching for " keyword" won't due to the whitespace. Every input boxes should trim their content.

Screenshot image Figure: Search input does not trim the string – if user clicks on β€œsearch” here, the list will be empty due to the whitespaces

Reproduction

N/A as this bug is found in every search fields in Tina

Steps to reproduce

  1. Navigate to https://www.ssw.com.au/admin/index.html#/collections/consulting/~
  2. In the search input, type " database "
  3. Click the search button "πŸ”"
  4. The result will be an empty list due to the whitespaces before and after the word "database"

Note: this issue occurs not only for the search, but also for other input validations

System Info

Windows 11, Chrome

Validations