Comments (5)
Same issue here
from alerttoast.
Hey, any workarounds? Seems this is not getting fixed
from alerttoast.
I have been looking at this and believe I have a fix. I'll raise a PR with my modifications.
The issue relates to changing from one displayMode
to another. It actually occurs not just on the first call, but any time a new AlertToast
is created with a different displayMode
. Since the initialiser defaults to .alert
, and first call is actually the second call (the first being the initialisation), the task to take the toast down is never created.
So, the workaround (without my changes) is to create the first AlertToast
with the displayMode
you intend to use throughout the rest of the app:
In your example @pulpfree, change this:
@Published var toaster = AlertToast(type: .regular) {
to this:
@Published var toaster = AlertToast(displayMode: .hud, type: .regular) {
The workaround does not work if you want to use more than one displayMode
in the same app.
from alerttoast.
Hey @pulpfree ,
I tried to reproduce this bug but with no success.
I guess that DispatchQueue
you've put in the sink operator has to do something that causes this kind of problem.
It's always better in Combine to use the .recieve(on:)
operator and not create a new thread inside the sink.
Also, check your custom operator to check for any problems there (resultPublisher
).
If you strip down your ObservableObject and keep only the Published variable you will see that it works as it should.
from alerttoast.
Hey @elai950. Thanks for the info, appreciate it.
from alerttoast.
Related Issues (20)
- Cannot find 'AlertStyle' in scope HOT 1
- No linebreaks in subtitle? HOT 9
- Background opacity of View when AlertToast type hud HOT 3
- Default alert width is too small to show message HOT 5
- Loading Toast Cannot Be Dismissed HOT 1
- toast<Item>(item: Binding<Item?>, content: (Item) -> AlertToast) modifier HOT 2
- Alert isn't positioning correctly under iOS 16 HOT 1
- tvOS compatibility possible? HOT 1
- Swipe to dismiss toast HOT 1
- If type is .loading, its background parent view is still clickable HOT 2
- No toast! Have implemented per instructions, but the AlertToast() does not respond with any visualisation. Have traced that it gets called, but nothing happens on screen. - Xcode 14.2, SwiftUI, iOS 16.2, Simulator and physical device. HOT 1
- Long Subtitle text doesn't correctly wrap in DisplayMode "hub" or "banner" HOT 6
- Toast Window Not Large Enough On MacOS: The text gets truncated and replaced with "..."
- Popover cuts off `.hud` alert HOT 5
- Create Example Project HOT 1
- The subtitle line gets cut off on iOS banners HOT 1
- Not usable as global modifier when sheet is presented HOT 7
- Is there any way to set the toast always on the top of screen, instead of on the center of view HOT 1
- System image not being displayed when AlertToast added to a package.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alerttoast.