Bug 36651

Summary: Add placeholder text to the search bar in the OPAC
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement updates the style of the OPAC search bar's placeholder text, the text which is shown in the text field when the user has not entered any text. Previously the style of the placeholder made it look very much like text the user had typed. Now the placeholder is right-aligned and italic in order to distinguish it from regular text, while keeping a color which has accessible contrast.
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 37412    
Attachments: Bug 36651: Add placeholder text to the search bar in the OPAC
Bug 36651: Add placeholder text to the search bar in the OPAC
Bug 36651: Add placeholder text to the search bar in the OPAC
Screenshot showing possible re-styling of placeholder text

Description Caroline Cyr La Rose 2024-04-19 14:38:38 UTC
I had this suggestion during a training yesterday. Some people were saying it was not obvious what the search bar was meant for, and it was suggested that maybe putting a hint text in the search bar would help understand. (Similar to the wiki search box https://wiki.koha-community.org/wiki/Main_Page, it says "Search Koha wiki" and when you start typing this text disappears.)

It could be customizable, but the default could be something like "Search the library catalog".
Comment 1 Owen Leonard 2024-06-11 12:10:57 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2024-06-12 12:24:13 UTC Comment hidden (obsolete)
Comment 3 Matt Blenkinsop 2024-06-12 13:58:11 UTC
Created attachment 167661 [details] [review]
Bug 36651: Add placeholder text to the search bar in the OPAC

This patch adds placeholder text to the OPAC search bar, with JavaScript
to change the placeholder based on the user's search type selection.

To test, apply the patch and go to the OPAC.

- The search bar should by default have the placeholder "Search the
  catalog by keyword"
- Change the search type (Author, Title, etc). The placeholder text
  should change accordingly.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 4 Katrin Fischer 2024-06-21 12:57:51 UTC
That's one of these changes I am not totally sure about. 
For me the difference between the typed in search terms and the placeholder text are visually not very strong. It might be related to not having the best screen, but that might make it a good test too. :)
I am happy to push as is to get some more eyes/opinions maybe. We got plenty of time now.
Comment 5 Katrin Fischer 2024-06-21 13:04:15 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Owen Leonard 2024-06-24 11:58:19 UTC
Created attachment 168010 [details]
Screenshot showing possible re-styling of placeholder text

(In reply to Katrin Fischer from comment #4)
> For me the difference between the typed in search terms and the placeholder
> text are visually not very strong.

We do have the capability of styling the placeholder differently than the normal text. That might make a good visual hint that the text isn't actually filling the input.
Comment 7 Katrin Fischer 2024-06-24 12:58:15 UTC
Comment on attachment 168010 [details]
Screenshot showing possible re-styling of placeholder text

I like this, can I have it? :)
Comment 8 Lucas Gass (lukeg) 2024-07-18 19:39:00 UTC
Enhancement will not be backported to 24.05.x series
Comment 9 Owen Leonard 2024-07-19 14:16:54 UTC
(In reply to Katrin Fischer from comment #7)

> I like this, can I have it? :)

See Bug 37412