-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding .searchable to a SwiftUI List populated with ObservedResults makes List not updated with new result #8096
Labels
Comments
piersonleo
changed the title
Adding .searchable to a SwiftUI List populated with ObservedResults makes List not updated
Adding .searchable to a SwiftUI List populated with ObservedResults makes List not updated with new result
Jan 11, 2023
Hi @piersonleo I cannot reproduce your issue with the given steps. Could you create a small app that reproduces this issue? |
sync-by-unito
bot
added
the
Waiting-For-Reporter
Waiting for more information from the reporter before we can proceed
label
Jan 24, 2023
Hi @leemaguire here's the sample app that reproduces this issue. I've included a toolbar to quickly add a new object to the database. |
github-actions
bot
added
Needs-Attention
Reporter has responded. Review comment.
and removed
Waiting-For-Reporter
Waiting for more information from the reporter before we can proceed
labels
Jan 25, 2023
@piersonleo Thanks for this we will investigate. |
sync-by-unito
bot
removed
the
Needs-Attention
Reporter has responded. Review comment.
label
Jan 26, 2023
I've found the cause of this. I'll get a PR up shortly. |
Great! Hope it gets merged soon! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How frequently does the bug occur?
Always
Description
I have a SwiftUI list that I populate using ObservedResults. So everytime there's a change to the database my list would be updated.
Since I want to be able to filter my list, I added .searchable to the list. But after adding .searchable to the list, it doesn't get updated anymore when I added a new result to my list. To make the list update I have to search for it first from the search bar.
If I remove the searchable my list is updated with new result as expected after adding.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
Here's the code of my view
And my add function is simple like this, which I call from another view
Version
12.13
What Atlas Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Monterey 12.6.1
Build environment
Xcode version: 14.1
Dependency manager and version: ...
The text was updated successfully, but these errors were encountered: