[Solved] Dialog is triggering validation when displaying another Dialog?

0 Answers 25 Views
Dialog
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Rob asked on 25 Mar 2026, 10:49 PM | edited on 25 Mar 2026, 10:52 PM

The Map/Route dialog is set with "CloseOnOverlayClick".  As soon as I display the Route Dialog it triggers prior form validation (see the Destination red text behind the Route dialog)?

<TelerikDialog @bind-Visible="@_viewRouteMap"
               ShowCloseButton="true"
               CloseOnOverlayClick="true">
    <DialogTitle>Route</DialogTitle>
    <DialogContent>
        <Map ZipCodeModelOrigin="@_selectedZipCodeOrigin" ZipCodeModelDestination="@_selectedZipCodeDestination"></Map>
    </DialogContent>
</TelerikDialog>

I've used my Route/Map component on other pages/components and not having this validation trigger issue.  It seems if I go more than 1 level of Dialogs I'll get this issue?

The code that makes the Map/Route dialog visible:

private async Task MapGeneralRateRouteHandler(MouseEventArgs args)
{
    // Get the coordinates from the ZipCodes table using current Origin, Destination zip code
    _selectedZipCodeOrigin = await ZipCodeService.GetByZipCode(_rateDispatch.OriginZipCode);
    _selectedZipCodeDestination = await ZipCodeService.GetByZipCode(_rateDispatch.DestinationZipCode);
    _viewRouteMap = true;
}
Why is validation being triggered when I make another dialog visible?

 

Dimo
Telerik team
commented on 26 Mar 2026, 07:04 AM

Hi Rob,

I have two assumptions:

  • When the second Dialog appears, a textbox in the first Dialog (and Form) is blurred, which is expected to trigger validation.
  • When the second Dialog appears, the UI refreshes, which shows failed validation that already occurred before that.

Our Dialog component has no relevance to validation algorithms.

Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
commented on 30 Mar 2026, 03:44 PM | edited

Hi Dimo,

Confused, why would opening another Dialog (in this case when I click the "Route" green button) trigger validation on the current dialog?  Can the behavior be prevented or circumvented?

Rob.

EDIT: oops, the issue was my error ... forgot to set ButtonType:

<TelerikButton OnClick="@MapGeneralRateRouteHandler" ButtonType="ButtonType.Button" Class="custom-compact-grid-button btn-green" Icon="@SvgIcon.Locations">Route</TelerikButton>

No answers yet. Maybe you can help?

Tags
Dialog
Asked by
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Share this question
or