Skip to content

feat: searchable mode for inline item filtering#26

Merged
gfargo merged 1 commit into
mainfrom
feat/searchable-mode
May 5, 2026
Merged

feat: searchable mode for inline item filtering#26
gfargo merged 1 commit into
mainfrom
feat/searchable-mode

Conversation

@gfargo
Copy link
Copy Markdown
Owner

@gfargo gfargo commented May 5, 2026

Summary

Implements #14 — adds searchable/filterable mode for inline item filtering.

Changes

  • searchable?: boolean prop enables inline search
  • searchPlaceholder?: string customizes placeholder text
  • Case-insensitive substring matching on item labels
  • Search input renders above item list (/ query)
  • "No matches" shown when query matches nothing
  • Backspace removes last char, Escape clears query (then onCancel)
  • Vim keys and hotkeys disabled in searchable mode (chars go to query)
  • Space treated as search character
  • Selection resets to first match on query change
  • searchQuery exposed in hook result
  • Works with limit, groups, and disabled items
  • 22 new tests (106 → 128 total)
  • Documented in README

Testing

yarn test  # 128 tests passed
yarn lint  # clean

Closes #14

- Add searchable?: boolean to UseEnhancedSelectInputProperties
- Add searchPlaceholder?: string to Properties (component-level)
- Filter items by case-insensitive substring match on label
- Render search input line above item list (/ query or / placeholder)
- Show 'No matches' when query matches nothing
- Backspace removes last character from query
- Escape clears query first, then calls onCancel if already empty
- Vim keys (h/j/k/l) treated as search characters, not navigation
- Hotkeys disabled in searchable mode
- Space treated as search character (not multi-select toggle)
- Selection resets to first match when query changes
- searchQuery exposed in UseEnhancedSelectInputResult
- Works with limit/pagination, groups, and disabled items
- 22 new tests (106 → 128 total)
- Documented in README with examples and props table

Closes #14
@gfargo gfargo merged commit 0c81254 into main May 5, 2026
3 checks passed
@gfargo gfargo deleted the feat/searchable-mode branch May 5, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: searchable mode — type to filter items inline

1 participant