Mijick / Popups

Popups, popovers, sheets, alerts, toasts, banners, (...) presentation made simple. Written with and for SwiftUI.
Apache License 2.0
1.38k stars 61 forks source link

Is it possible to hide the BottomPopup by tapping anywhere on the screen? #137

Closed hhmy27 closed 4 weeks ago

hhmy27 commented 3 months ago

Great tool, thank you! I'd like to know if BottomPopup can achieve this effect: a user action triggers the BottomPopup, but it doesn't add a shadow to the main interface (in the Demo, it turns the interface gray), and the user can tap anywhere, or set an expiration time, for the BottomPopup to automatically close?

In this scenario, BottomPopup acts like a notification view. Users don't need to interact with it. For example, when a user has just copied/pasted text, a popup appears to confirm successful copying or pasting. This implementation would be very useful.

FulcrumOne commented 1 month ago

Hey @hhmy27,

Did you try modifier tapOutsideClosesView()? It should do exactly what you need.

Have a nice day, Tomasz