-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using DatePicker inside a PropertyColumn on a MudDataGrid, date does not update on selection. #8906
Comments
Hi.
Are you sure in your statement? But it works just fine when I have a normal class that holds the |
This is tricky to explain, but it's expected behavior. |
Thank you so much for getting back to me so soon. Yes sorry my mistake I was trying to simplify the actual example and saw the behavior of not updating was the same and assumed I had done a good job. I have updated my test code to more closely resemble the actual code I am having an issue with after the MudBlazor Update until I found the issue happening. Then I took most of it out again ensuring the issue still existed. I still may be doing something incorrect but it turns out after the update I am only having the trouble when utilizing the DatePicker Property TextChanged Here is my updated test using your working example as a base. https://try.mudblazor.com/snippet/caQSYJuCniMeLjum Please let me know if I should be doing something different or if this is a bug. Thanks again for your time. Kind regards Shane |
From your code sample, I think this is the reason. When this method get called StartDateChanged(Item? item), it still have the old value passed to it. So the data bind event of the grid happens after StartDateChanged. |
Hi again. Any reason you are not satisfied with the
This is correct. I haven't yet tested if this indeed worked in previous versions, but I'd be surprised if it did and I actually don't recall any DataGrid changes for the |
The only thing I can think of, is that earlier the |
@henon @Anu6is this change #8382 "broke" it. |
I think the component just needs some attention. Update to the new parameter state usage and see if any of the logic can be streamlined/simplified |
Thanks for the Info, to give you an idea of why I am using TextChanged as well as @bind-Date. If the full code I actually use PickerClosed as well but that event is still working as before. The @bindDate is bound to a date property of an object that is a part of a collection assigned to the grid. @bind-Date updates the value perfectly well, but I am looking for an event to have the modification of that date affect other dates in the collection to make user input easier. For example in the actual code the object has a StartDate and an EndDate, when the user updates the start date depending on if they used a text change or a picker change we are catching that event and updating the equivalent finished date. With out the individual event for the specific date being changed it would be difficult to determine which date was changed in the larger object to know which end date to update. Let me know if this doesn't make sense I can update an example further to illustrate if you like. Kind regards Shane |
Do I understand correct that you just need an event when the binding is updated? <MudDatePicker @bind-Date="date" @bind-Date:after="DateUpdated" /> Unfortunately the |
Great, thanks! you learn something new every day. That is working, I'm going to need to work on my Error notifications on the DatePicker now as they seem to now appear in times that they did using the old method but the date is updating and the corresponding date is being updated correctly as well. Thank you! |
I use @key to refresh DatePicker |
Hi, I will close this issue since we have helped as much as we could. |
Bug type
Component
Component name
MudDataGrid / MudDatePicker
What happened?
After updating from Version 6.17 to either 6.18 of 6.19.1, The DatePicker no longer sets its date on selection when embedded in a Property Column on a MudDataGrid.
Expected behavior
After Selecting a Date the displayed date is expected to update to reflect the selected date.
Reproduction link
https://try.mudblazor.com/snippet/macoaTYBIulQldPP
Reproduction steps
3.The date does not update.
Relevant log output
No response
Version (bug)
6.18 and 6.19.1
Version (working)
6.17
What browsers are you seeing the problem on?
Firefox, Edge
On which operating systems are you experiencing the issue?
Windows
Pull Request
Code of Conduct
The text was updated successfully, but these errors were encountered: