davidbures,
@davidbures@mstdn.social avatar

Is there a way to display a .searchable field in a .sheet on macOS?

I have this simplified code:
NavigationStack {
VStack {
}
.searchable
}
(the code above is in a .sheet)
But the searchable field is not displaying 🤔

ctietze,
@ctietze@mastodon.social avatar

@davidbures does it display on a VStack outside a sheet etc?

davidbures,
@davidbures@mstdn.social avatar

@ctietze I just tried it on a barebones project and yes, it does work

ctietze,
@ctietze@mastodon.social avatar

@davidbures ah it goes into the toolbar; sheet's don't have that by default 🤔

davidbures,
@davidbures@mstdn.social avatar

@ctietze I even tried to add a navigation title to the sheet and that still didn’t do anything 🤔 Do you have any other ideas I might try?

ctietze,
@ctietze@mastodon.social avatar

@davidbures I'm not even sure you can display a window as a sheet on macOS with a toolbar!

davidbures,
@davidbures@mstdn.social avatar

@ctietze 😢 so I suppose there’s no way to do it? It’s a shame that you can do it on iOS using the navigation stack trick, but not on macOS

FredericBronner,

@davidbures Is it possible it is being displayed in your main window in the navigation bar on the right? That is what was happening to mine and ended up putting a UIKit search bar in the sheet.

davidbures,
@davidbures@mstdn.social avatar

@FredericBronner I just checked and no, the field is not displayed in the main window

  • All
  • Subscribed
  • Moderated
  • Favorites
  • SwiftUI
  • DreamBathrooms
  • ngwrru68w68
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • tacticalgear
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • ethstaker
  • JUstTest
  • GTA5RPClips
  • modclub
  • tester
  • Leos
  • osvaldo12
  • cisconetworking
  • everett
  • cubers
  • normalnudes
  • anitta
  • megavids
  • provamag3
  • lostlight
  • All magazines