Notification doesn't work

1 Answer 109 Views
Notification
Maurice
Top achievements
Rank 1
Veteran
Maurice asked on 14 Sep 2022, 09:13 AM

Probably I do something very simple wrong but I try to follow the single instance per app example and if I debug my code I can see the cascading variable getting the instance.

I can send the following code without any error in the code or in the console of my browser

Notification.Instance.Show(new NotificationModel
{
Text = "TEST",
ThemeColor = ThemeConstants.Notification.ThemeColor.Error,
CloseAfter = 30000,
Closable = true
});

But I will not see the notification on screen.
It doesn't matter if this is somewhere in the code or in the 

protected override async Task OnAfterRenderAsync(bool firstRender)

or 

protected override void OnInitialized()

1 Answer, 1 is accepted

Sort by
0
Accepted
Radko
Telerik team
answered on 15 Sep 2022, 09:17 AM

Hi Maurice,

Given you are correctly passing the Notification object as a Cascading parameter and are invoking the Show method, I see no reason why the notification will not appear. A possible issue that comes to mind is related to the notification's z-index, as in, it might be in fact appearing, just being hidden by the page content already present there. Could you have a look at the following article which might help, if this is the case: Notification - Z-Index.

If this is not the issue, could you please see if our example works as expected for you? The example has been updated to run on .NET 6 and use our latest package version, so it should be runnable without the need for any changes. Here is a link to it: https://github.com/telerik/blazor-ui/tree/master/notification/single-instance-per-app

If you are still having issues, would it be possible for you to prepare a small project that reproduces the behavior, so we can have a look?

Regards, Radko Stanev Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Maurice
Top achievements
Rank 1
Veteran
commented on 15 Sep 2022, 09:57 AM

It was the Z-INDEX.

Now it works

Tags
Notification
Asked by
Maurice
Top achievements
Rank 1
Veteran
Answers by
Radko
Telerik team
Share this question
or