blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

Fix issue #836

Open Suiram1701 opened this issue 1 year ago • 5 comments

  • Issue #836 (opened by me) fixed.
  • Adds ToastService.NotifyAsync(ToastMessage) suggested by @shargon

Suiram1701 avatar Aug 14 '24 11:08 Suiram1701

@Suiram1701 Thank you for the PR. I'll take care of this.

gvreddy04 avatar Aug 19 '24 17:08 gvreddy04

Can this be merged in the next release?

shargon avatar May 17 '25 06:05 shargon

Any update with this issue?

shargon avatar Jun 20 '25 18:06 shargon

gvreddy04 asked for a minimal repo to reproduce the issue (what I've provided) but didn't respond yet. This issue was also mainly caused by me who didn't understand how at the time how to use async in Blazor.

Suiram1701 avatar Jun 20 '25 18:06 Suiram1701

@shargon I've read your issue and it has the same source as mine. A Blazor renderer is attached to a specific thread and to modify a component (in this case the Toasts I think) from a different thread you have to use the dispatcher with InvokeAsync.

So try to call the toast service through InvokeAsync(() => ...). It's not very likely that this will be merged because no component does run InvokeAsync by its self.

Suiram1701 avatar Jun 20 '25 18:06 Suiram1701