SearchablePlayground: the LazyVGrid variant never filters

Open Beginner friendly
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
mobile

Research direction

Open Sources/Showcase/SearchablePlayground.swift at lines 124-141 and compare the LazyVGrid with the List and LazyVStack variants that use matchingAnimals(). Check how the grid consumes searchText, then verify that entering 5 leaves only matching tiles while the other Searchable examples still behave as before.

Written by the indexing model from the issue text.

Description

Where: Searchable › LazyVGrid —
SearchablePlayground.swift#L124-L141

Steps to reproduce

  1. Open Showcase › Searchable › LazyVGrid.
  2. Type 5 in the search field.

Expected: the grid narrows to matching tiles, as the List and LazyVStack variants do through matchingAnimals().
Actual: all 100 tiles remain.

Cause: .searchable(text: $searchText) is attached, but searchText is never read; the grid iterates ForEach(0..<100) unconditionally (L130).

Suggested fix: filter the indices, e.g. ForEach((0..<100).filter { searchText.isEmpty || String($0).contains(searchText) }, id: \.self).

Dominant language
Swift
Stars
44
Forks
19
Avg merge
6h 27m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skiptools/skipapp-showcase

All issues in skiptools/skipapp-showcase

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.