Skip to content

[FEATURE] Add clear button (X) in search input #177

@ascender1729

Description

@ascender1729

Description

Add an X button inside the search input to quickly clear the current search text.

Why Needed

  • Faster than selecting all + delete
  • Standard input pattern
  • Improves mobile usability

Implementation Details

  • Show X button only when input has text
  • Position inside input on the right
  • Clear input and optionally reset results
  • Focus remains in input after clear

Files to Modify

  • src/components/results/ResultsContainer.svelte

Code Example

<div class="relative">
  <input bind:value={searchQuery} />
  {#if searchQuery}
    <button 
      onclick={() => searchQuery = ''}
      class="absolute right-2 top-1/2 -translate-y-1/2"
      aria-label="Clear search"
    >
      <XIcon />
    </button>
  {/if}
</div>

Acceptance Criteria

  • X button appears when input has text
  • Hidden when input is empty
  • Clears input on click
  • Keyboard accessible

Time Estimates

  • With AI: 135 minutes
  • Without AI: 900 minutes

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions