Scheduler: OnAppointmentClick error

Hi, you are using version 4.34.3.

I am using the calendar with month view:

<RadzenScheduler @ref=@scheduler									 
     TItem="SearchBalanceScheduler" Data=@lstSchedulerItems
     StartProperty="Start" EndProperty="End"
     TextProperty="Text" SelectedIndex="0" 
     AppointmentRender=@OnAppointmentRender AppointmentSelect="@OnAppointmentSelect" 
     SlotSelect=@OnSlotSelect SlotRender=@OnSlotRender										 
     AppointmentMouseEnter=@OnAppointmentMouseEnter AppointmentMouseLeave=@OnAppointmentMouseLeave
     LoadData="@(args => isSchedulerDataLoaded ? OnSchedulerLoadData(args) : Task.CompletedTask)" Date="@dtSchedulerView.Value">
					<Template Context="data">
						<RadzenStack JustifyContent="JustifyContent.SpaceBetween" Orientation="Orientation.Horizontal" Style="align-items: flex-start !important;">
							@data.Text
					</RadzenStack>
				</Template>
				<ChildContent>
					<RadzenMonthViewExtended MaxAppointmentsInSlot="3" />
				</ChildContent>
</RadzenScheduler>

It doesn't happen often, but when I change pages the following error message is generated in the console, about OnAppointmentClick:

blazor.server.js:1  [2024-11-12T15:01:55.838Z] Error: Microsoft.JSInterop.JSException: Unable to focus an invalid element.
Error: Unable to focus an invalid element.
    at Object.focus (https://localhost:44321/_framework/blazor.server.js:1:33459)
    at https://localhost:44321/_framework/blazor.server.js:1:3244
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (https://localhost:44321/_framework/blazor.server.js:1:3201)
    at Yt._invokeClientMethod (https://localhost:44321/_framework/blazor.server.js:1:61041)
    at Yt._processIncomingData (https://localhost:44321/_framework/blazor.server.js:1:58516)
    at Yt.connection.onreceive (https://localhost:44321/_framework/blazor.server.js:1:52157)
    at s.onmessage (https://localhost:44321/_framework/blazor.server.js:1:80302)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Radzen.Blazor.Rendering.MonthView.OnAppointmentClick(AppointmentData data)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Radzen.Blazor.Rendering.Appointment.OnClick()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Thank you!

Any ideas about it?

Thanks!

Hi @rsalemi,

We will need a reproduction of this error in order to provide any info. It is close to impossible to debug sporadic errors like the one you describe otherwise.