Skip to content

enhancement: Add 1-click Clear button (X) inside SearchField #265

Open

Description

@O2sa

In src/features/leaderboard/components/search-field.tsx, users can filter developers or countries by typing into the search input. While keyboard users can press Escape to clear, mouse and touch users must manually backspace all characters.

Motivation

A clear button (X) is standard search input UX on desktop and mobile, enabling fast filter reset.

Tasks

  • When value.trim().length > 0, render an icon button with X (from lucide-react) positioned at end-2.5.
  • Clicking the button calls onChange("") and retains focus on the input.
  • Ensure the shortcut badge / is hidden when the clear button is shown to avoid visual overlap.
  • Provide an accessible aria-label for screen readers.

Files to Check

  • src/features/leaderboard/components/search-field.tsx
  • src/locales/en.json & src/locales/ar.json

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Activity

  1. aryansinha1908 commented on Oct 23, 2026

    @aryansinha1908
    Contributor

    assign me

  2. github-actions commented on Oct 23, 2026

    @github-actions

    🎉 Issue assigned to @aryansinha1908! Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions