radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.45k stars 775 forks source link

Date is not selected when using RazdenDatePicker in OnDemand PopupRenderMode. #1473

Closed uittorio closed 4 months ago

uittorio commented 5 months ago

Describe the bug

Dates are not selected when using RazdenDatePicker in OnDemand PopupRenderMode.

To Reproduce Steps to reproduce the behavior:

  1. Go to (https://blazor.radzen.com/datepicker)
  2. Scroll down to first example
  3. Click on Edit Source
  4. Add PopupRenderMode="PopupRenderMode.OnDemand" to the RadzenDatePicker
  5. Run the new code
  6. Open the popup to select date
  7. Select a date
  8. Observe that the date is not selected

Expected behavior Date is selected and displayed

Screenshots image image

Desktop (please complete the following information):

By changing the PopupRenderMode to PopupRenderMode.Initial it works.

I've noticed that if I use the keyboard to select the day instead of the mouse it works regardless of the render mode.

I've tried to remove extra event listeners by selecting the element in the browser! I've found out that by removing a mouseup event listener the component was working as expected but I couldnt determine what code was attached to the event.

Hopefully this helps!

enchev commented 4 months ago

Here is what I see: dp-ondemand

uittorio commented 4 months ago

I can still reproduce it on the browser version I've mentioned above. Which browser/OS are you using? I will ask around to try it with different browsers and let you know

I've also tried on Windows Chrome and the same issue happens

Chrome -> Version 124.0.6367.61 (Official Build) (64-bit) image

colinbate commented 4 months ago

I am also seeing this on Windows latest Chrome and Firefox. The mouseup fires and runs Close() which closes and removes the popup, and then the click event doesn't get a chance to fire. That is why it works when you do it via keyboard: no mouseup event. The click event triggers on the enter press and runs SetDay() which contains its own call to Close().

I'm seeing this in my own application as well as the documentation example.

enchev commented 4 months ago

Thanks @colinbate! I was able to reproduce it and will remove mouseup code.