Hi, Julian,
Thank you for the example.
Basically, the spinners are taken as a part of the DateInput element that when clicked, opens the Popup. As a solution, you can handle the click event on the spinner buttons where you first need to give them the click event listener. In addition, you should stop the event propagation in order to not open the popup, and finally, increase or decrease the date value based on which button is clicked:
As the solution is very custom and additional code on the user's side, I will change the portal status of this feature request to add the Spinners to the DatePicker component from declined to unplanned. Having a spinners prop that automatically renders the spinner component that is handled in all scenarios is much more convenient.
Moreover, I updated your Telerik Points accordingly as a small token of gratitude for your suggestion.
If you have any questions, please let me know.
Regards,
Wissam
Progress Telerik
Hello,
I was working on implementing the example you provided with the DateInput being passed into the DatePicker. I have run into an issue when the DatePicker's adaptive is set to true. Any time you click on a DateInput spinner to change the date, the calendar pops up.
The following example demonstrates the issue, it is just what you had plus adaptive={true}
https://stackblitz.com/edit/react-ugado1-zgymnl?file=app%2Fmain.tsx
Is there a way to keep the calendar from popping up when the value is changed via the custom DateInput?
Thank you
Hello, Julian,
I will provide you with a solution on a new thread in order to keep the information consistent:
Regards,
Wissam
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!
Hi Wissam,
Thanks for the example. It is what I was looking for. I had seen the documentation on customizing the DatePicker but hadn't thought of simply passing it a DateInput with the spinner enabled. An elegant solution.
Now my only problem is that my users expect the spinner to control the day by default instead of the month. I've submitted a feature request for that.
https://feedback.telerik.com/kendo-react-ui/1645610-have-dateinput-spinners-adapt-to-the-selected-date-part
Please let me know if you have another creative solution to handle that requirement using the existing controls as well.
Thank you,
Julian
Hi, Julian,
Since this feature is available for the DateInput component, you can achieve this to the DatePicker by custom rendering its date input component. (The DatePicker uses the DateInput internally by default).
In the below example, I am setting the dateInput prop to `CustomDateInput` where I am returning the DateInput components with its spinners prop set to true:
For more information on customizing the DatePicker, check the following article:
I hope this helps, but please let me know if you have any further questions.
Regards,
Wissam
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!