Last Updated: 30 Oct 2023 11:00 by Jack
Created on: 30 Oct 2023 11:00
Category: Scheduler
Type: Bug Report
Scheduler throws when navigating to another page before the component is fully initialized

I am using the Scheduler component in Telerik for Blazor and am getting an intermittent exception being thrown, usually when navigating quickly through the application (ie. navigating to another page before the initial page containing the Scheduler has finished rendering).

This is the exception received:




The Scheduler must render in the browser and then it measures and adjusts its layout with JavaScript. You may hit this error if the component is disposed before or during this JavaScript call.

Example use cases:

  • Navigating to a different page before the full component initialization


    The possibility to hit that is higher in case the Scheduler needs more time to initialize (e.g. it has to render a large set of appointments). In such a scenario, it will be useful to optimize the time needed for loading the appointments, so that the initial component rendering is not blocked by waiting all the data. For that purpose, you may load the appointments on demand - not fetching all possible appointments at once, but only when the user should see them. An example of such an implementation you may find here: https://github.com/telerik/blazor-ui/tree/master/scheduler/load-appointments-on-demand.

  • Disposing the component during runtime (e.g. depending on the screen size)https://blazorrepl.telerik.com/wIuHliEt40SutaBI53.


    Potential solution in this case - render component after calculating the screen size: https://blazorrepl.telerik.com/coEnPWON4570Wna007.