elm-community / elm-faq

FAQ about the Elm language.
https://faq.elm-community.org/
22 stars 24 forks source link

Search field "too" case-sensitive? #23

Closed jvoigtlaender closed 8 years ago

jvoigtlaender commented 8 years ago

Actually, it seems to be case sensitive for some content, but not for other content. At least I cannot otherwise explain why there is a difference in behavior (filtered results) between starting to type "Repl" vs. "repl", but no such difference between starting to type "Report" vs. "report".

And it's unfortunate that there is such case sensitivity, since at least on mobile for me, when I start typing in an empty input field, it always starts uppercase...

fredcy commented 8 years ago

The search works as in Emacs: if the search string contains any upper-case characters then the search is done case-sensitive; otherwise it is case-insensitive.

https://github.com/fredcy/doc-filter/blob/de2d61fc9241988053df1e19ddfd47568d38bda9/Filter.elm#L105

It's easy to change the program such that search is always case-insensitive, of course. Is that what you want? Perhaps the approach I used is not as commonly understood as I thought.

jvoigtlaender commented 8 years ago

Ah, I see. So the difference between the cases of "repl" and "report" was due to to me invisible words inside the section content (I thought only titles are searched).

But anyway, while I do use Emacs and know about the behaviour there, I would expect the search on the site here to be completely case insensitive.

A cheap justification would be that that's exactly like the search box on the Elm package site works.

fredcy commented 8 years ago

OK, the search is now case-insensitive.

jvoigtlaender commented 8 years ago

Cool!