Skip to content
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

Fix Search bar disappearing on Discover tab when scrolling #1680

Merged
merged 6 commits into from
Oct 22, 2024

Conversation

pelumy
Copy link
Contributor

@pelumy pelumy commented Oct 22, 2024

Issues covered

#1679

Description

This PR fixes the Search bar disappearing on Discover tab when scrolling. This is fixed by using the custom SearchBar instead of Apple's .isSearchable modifier.

How to test

  1. Navigate to the discover tab.
  2. Scroll through the recommended profiles.
  3. Please check that the search bar is still visible and doesn't disappear.
  4. Go to a different tab and switch back to the discover tab.
  5. Please check that the search bar is still visible after switching back.

Screenshots/Video

Before After
Before After

@mplorentz
Copy link
Member

👀

Copy link
Member

@mplorentz mplorentz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing a few minor issues here:

  • Typing a query then tapping clear sometimes results in the loading view being displayed instead of featured authors
  • I think the gap between the magnifying glass and placeholder text is too large
  • The font in the search bar doesn't look the same as the one in Figma.
    I'm going to take a crack at fixing these since I think you are offline.
  • font for query

@mplorentz
Copy link
Member

I fixed up the fonts. I ended up using the .placeholder modifier that we already had because it was simpler than adding more parameters to PlaceholderModifier. Let me know what you think! But I'm going to go ahead and merge this so we can get into the App Store review queue!

@mplorentz mplorentz merged commit df90d41 into main Oct 22, 2024
4 checks passed
@mplorentz mplorentz deleted the fix-disappearing-searchBar branch October 22, 2024 21:42
)
)
.placeholder(when: $text.wrappedValue.isEmpty, placeholder: {
Text(placeholder)
Copy link
Contributor Author

@pelumy pelumy Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waawu, I didn't know this was existing. This is great @mplorentz

@pelumy
Copy link
Contributor Author

pelumy commented Oct 23, 2024

I love the new approach and I feel it is cleaner. We should change the other place where the modifier was used after the launch. Thanks for fixing this @mplorentz.

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.

2 participants