-
-
Notifications
You must be signed in to change notification settings - Fork 999
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
fix(module: RangePicker): Always run default disabled logic, even with custom function provided #2947
Conversation
314d426
to
0bded29
Compare
Thanks for contribution @wss-kroche , I think we can implement 'Disabled Date & Time' as antd directly. |
I'm not sure I understand what you mean. Disabled date/time is implemented in ant and in ant blazor, but there is default logic for that disabled date for range picker that keeps the dates in the correct order. We need custom logic for disabled date, but we need the default as well because if you pick the dates in the wrong order the component completely breaks too. This is adding the option to override the default logic or use both. |
site/AntDesign.Docs/Demos/Components/DatePicker/demo/RangePickerDemo.razor
Outdated
Show resolved
Hide resolved
Ok, I see it. But I don't get the idea why do you need "Custom Disabled Only". |
Only to give flexibility to allow running custom, default or both. Do you think the default should always run? I wasn't sure if it should always run or not but if it should we can just make it always run and use the DisabledDate as an additional one to run. That would be a breaking change though and need to go to feature as well I think. |
Yeah, I think that's more close to antd's behavior.
This can be seen as a bug, so we can keep it all at master. |
f6b6af7
to
a838af9
Compare
I've updated the logic to always apply default and updated the change comment |
… default logic even when custom is provided. This keeps ranges in the proper order even with custom disabled logic.
a838af9
to
ae67f45
Compare
Codecov ReportBase: 43.61% // Head: 45.01% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2947 +/- ##
==========================================
+ Coverage 43.61% 45.01% +1.39%
==========================================
Files 551 551
Lines 25918 25915 -3
Branches 263 263
==========================================
+ Hits 11305 11666 +361
+ Misses 14573 14209 -364
Partials 40 40
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
…h custom function provided (ant-design-blazor#2947)
We ran into the need to use custom disabled logic, but also wanted to keep the default logic that kept the start/end in the proper order.
This PR adds a property to allow that setting which "mode" you want to use and then wraps the DisabledDate function provided in a method to check the type of check to run. It then either runs one or both.Through discussion below, this PR updates the disabled logic to always apply the default logic even when custom is provided.
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge