Closed johanpolak closed 6 days ago
I'm unable to replicate such issue in our demos. The default value of PopupRenderMode is Initial:
and using our first DatePicker demo with ReadOnly=true doesn't allow date selection:
I see. Like this it doesn't allow date selection indeed. I changed the value of ReadOly from false to true by code after rendering. Then it is possible to open the popup and select a date. I will look into it how to make this work. Thanks for your quick response.
Changing the value of this property after render will not take desired effect - the component should be rerendered.
Hi @enchev,
I tried this. After changing the value for readonly I called the 'StateHasChanged' to force the component to be rerendered. However, a click on the datepicker still opens the popup. The behavior of the datepicker is the same as if the parameter AllowInput is set to false, so a click on the inputfield toggles the popup.
After some research I found out that in the javascript function 'createDatePicker' (https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/wwwroot/Radzen.Blazor.js#L1018) a handler is added to the button and the input in the datepicker which still exists after a rerender. I think this is the source of the problem I'm facing right now.
Can you re-open the ticket and fix this? Thanks in advance.
Describe the bug If a datepicker is set to readonly, but de PopupRenderMode isn't set to OnDemand, the user is still able to open the popup and select a date. I guess this shouldn't be possible.
Expected behavior A user should not be able to open the popup and select a date if the datepicker is set to readonly, no matter what the PopupRenderMode is.