https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43158

--- Comment #3 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 202517
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202517&action=edit
Bug 43158: Add clear button to OPAC catalog search input

Adds a clear (x) button inside the OPAC masthead search input that
appears when text is present, allowing users to quickly clear the
search box.

The native HTML5 type=search clear button is not supported in Firefox,
so a cross-browser JS+CSS approach is used instead:

- JS wraps the input and appends a positioned clear button
- Button shows/hides based on input content
- Clicking clears the input and refocuses it
- CSS positions the button inside the input field
- Works consistently in Firefox, Chrome, and Safari

Test plan:
1. Apply patch
2. Run:
   $ ktd --name bug_43158 --proxy up -d
   $ ktd --name bug_43158 --wait-ready 120
   $ ktd --name bug_43158 --shell
  k$ npm run css:build && koha-plack --restart kohadev
3. Navigate to the OPAC
4. Type something in the search box
=> SUCCESS: clear (x) button appears on the right side
5. Click it
=> SUCCESS: input is cleared and refocused
6. Verify button is hidden when input is empty
7. Test in Firefox and Chrome
8. Sign off :-D

Assisted-by: Sonnet 4 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to